i'm having the same problem and i can give you a temporary solution to charge your s4. You should charge your phone in switch off mode..
and perhaps this is the problem of sensors. i think your temperature sensor is not working ( & mine too). and i don't know about the replacement cost of the...