The battery must have gone bad! if its three or more years old you need to get a new battery for the computer. Periodic conditioning of the battery from first use may prolong the battery life. Battery life is reduced by plugging computer with battery all the time.
Conditioning. Periodic full charge and full discharge practice is good for battery. Batteries are better charged when they are at less than 10% power and its better to charge them to 100%. Do not leave on electric power once they are fully charged.
I hope this helps in future but current battery may need replacement!
Batterys in laptops are now Lithium Ion batterys (li-ion) these batteries do not have a memory effect so it does not matter if you leave the laptop plugged in or not, you will not affect the performance