Have you tried resetting the SMC? You would be surprised at how many things it can fix? If that fixes it, and the problem comes back, then you might have a bad internal battery(not the actual battery that you charge and use).

“If you are distressed by anything external, the pain is not due to the thing itself but to your own estimate of it; and this you have the power to revoke at any moment.” Marcus Aurelius