Charger broken or DC jack got loose.
It looks like there is problem with your laptop port.
Laptop doesn't work when plugged in, but does work with battery. But when I turn on laptop with battery and charger, it starts to lose cell quickly.
You leave your charger in your outlet too much while you are not using it. Therefore you short circuted it & may need a new charger.
You better to change the power settings. Else remove your battery and check the battery whether it's in free of dust.
It could have 2 reason
1) adopter is not working properly
2) Battery is faulty
1) adopter is not working properly
2) Battery is faulty