This happened to me2 days ago, I even broke my charger because of the frustration. Tried like 5 cords..
All I did was switch it off and just leave it "charging". While I was waiting to meet up with the person I was buying a new One Max I just held the power button forever and the phone came back on fully charged
I was ready to move on lol
Sent from my One XL using xda app-developers app
(Primary) HTC One MAX , (Backup) HTC HD2 , Best 1-2 punch