Probably a short somewhere & probably caused by moisture. That's the nature of it, damage occurs very slowly/over a long period of time & there isn't a lot you can do about it.
Start with the obvious/cheap stuff first; clean battery contacts with isopropyl alcohol, then replace battery, then replace USB board - KeithRoss39 has a guide to enable you to do this yourself easily/quickly/cheaply (~US$10).
That's about all you can do easily yourself, from there you'd be looking at replacing the motherboard, but unless you already have the experience with electronics like this, you're going to be paying someone else to do that.
Even though it's more than likely not a software issue, do a completely clean install of stock anyway, because it costs you nothing.
If it's important enough to cause you grief if it's lost, back it up. No excuses
Trolling for thanks is lame
Does Samsung's auto-brightness implementation crap drive you to self-harm ? A solution !
Failure to search is the leading cause of male impotence on XDA
If you don't know how to recover if things go wrong, what are you doing flashing custom roms ?