Both above solutions will work.
The way I would do is simply use the 'max' system expression.
hp = max(0, Hero.damage - Enemy.Defense)
this way, it will take the maximum value from the two parameters. Which means, when the subtraction goes negative, it will choose 0 as hp.