And no, even setting something to something like 1 billion HP wont stop that. Because when you take damage the game then looks at the actual max HP of the unit, sets the current HP to that, and then subtracts the damage.
The devs seemed to have anticipated this sort of tomfoolery.