Re: my samsung galaxy keeps discharging while charging
The most often cause of this problem is a bad USB cable. Have you tried a new one of them? The battery and charger itself are two other possibilities, but you took care of those. There's two other possibilities. The port itself could be going bad inside the phone. This may also cause data connection issues when trying to transfer data with a computer.
The last thing I can think of is a rogue app that is chewing up processing time. If that were the case, you'd notice extra lag and the phone would be hot from the amount of work it'd be doing. Phones are typically designed to at least be able to trickle charge even under heavy use. It'd take something fairly intensive, like 3D gaming, to draw enough power that you see anything close to that being an issue. So I kinda doubt this is your problem.