The HD2 has a history of overheating, specially when performing tasking operations, like playing games or watching videos.
This probably boils down to the software currently in your HD2, making it appear that it needs more battery than it should, thus the increase in temperature. Once the phone hits 32 degrees, it will either restart (reboot) or just shut down till it's cold enough. This protects the phone and it's components from burning or shorting itself from the inside out.
Same goes for performing the above examples, when you have the phone plugged in and charging. The phone basically discharges the charge it's getting from the plug, into whatever you are currently doing. Again, this has probably have to do with the software.
If you have a custom ROM (which I have), try to look for ROMs that have lower voltage draw. You can easily obtain such roms from websites such as XDA Developers. You can find all guides and steps needed to apply a new ROM.
Hope this helps :)