It is an aftermarket battery but it's my third battery and it worked fine when I got it. As of now, the battery has been on charge all night, and it's showing a 100% charge. Just unplugged it and it went into sleep mode and now shows 0% charge when I plugged it back in. I know if I shut down, and restart on battery only it'll be OK.
There's a good chance that replacing the battery will resolve the issue. Reinstalling all the drivers or the OS from scratch is free and it may also resolve the problem.