It seems that your problem is related to the HTC charger itself.
I have a suggestion that you probably should replace your HTC charger set, due to
prolonged usage of heavy gpu loading while charging.
I also would recommend that you should not always using your phone to perform heavy task /multi-tasking while charging.
Doing so will shorten the life-span of your HTC battery and damage both your HTC inbuilt battery and charger easily, and worn out or misbehaviour eventually after a couple of months.
They are also many other reasons to cause this behaviour, like
Dropping your charger too often ,or the wire for your HTC charger , etc..
It 's just some advice from me. Based on my observation and some little , minor experience.
Not saying that I'm always right , but I did my best here to help you out.
Lastly, hope you solved your problem soon and your HTC one is back alive as normal. Cheers