Sorry to say but when your phone is to the point where it has issues that seem to be system deep, the only thing you can do that is almost guaranteed to fix it is flash the factory image to your device. This is different that doing a factory reset which doesnt really do a full system wipe and reload as far as I know. Instructions can be found here:
Note that you will need to backup everything off your storage (files/pictures/music/etc.). This will wipe your device clean.
Lastly, if your device thinks it is charging when its not, you could have a bad port. Hopefully its just the system though which can be fixed with the above suggestions. If not, you might need to have it fixed if possible. But it sounds like a system issue.
Galaxy Nexus (Kitkat), HP TouchPad (Jelly Bean)
Palm Pre Plus
Everything before that doesn't matter.