power cuts off because of faulty battery?

Oct 21, 2020
Hello, i have this problem for some time now, more than 6 months, but i manage to get around it.
In short: when the battery is inside, not connected to the outlet, it works fine, i get 4-5 hours of video playback even, so i'd say its in decent condition for a 5 yr old laptop. the problem comes when i connect the laptop to the outlet. on normal usage (internet, movies, documents, etc) it works fine, but if i start gaming or some serious hd videos, basically putting the parts on some stress demanding more power, it starts cutting power off. let me explain: when my laptop goes from ac to battery it makes a beep noise and the screen luminosity dims down a bit. i get this flickers from 1 every minute or so, 1 every 10-15 sec to 1 every second for a solid 20 seconds, it doesnt stop sometimes until i plug it off for a good minute or so.
If i remove the battery, the laptop works fine, no problems at all.
I tried every troubleshooting software i could find regarding this problem. checked all my hardware parts for errors, malfunctions (cpu, gpu, hdd, ram, coolers and everything left). i thought its the cable making problems, but considering without the battery it gets power just fine, i decided not to open up the ac brick.
The question is, if anyone ever heard of this problem, is it worth buying a new battery or a new power cable? oddly enough, i dont have any friends who have a similar laptop to mine, so i cant just try other power cables.
1 other thing to mention: when these problems started, i thought the problem is at the little thingy that goes inside the power socket in my laptop. I noticed some oily black liquid coming out of it, smelling a little like motor oil. I opened that, cleaned it and never appeared again, but the problem was still there, so i assumed that was not an issue. (the charging socket, cable and laptop work just fine, no problems since)