I prefer using floats to int for health values. Instead of comparing the health to 0, I simply check if the health would become lower than 0, like so:
float ATank::TakeDamage(float DamageAmount, struct FDamageEvent
const & DamageEvent, class AController *
EventInstigator, AActor * DamageCauser) {
float AppliedDamage = DamageAmount;
if (Health - DamageAmount < 0) {
AppliedDamage = Health;
Health = 0;
} else {
Health -= DamageAmount;
}
return AppliedDamage;
}