While I was mapmaking I was creating a Zombie Boss mob with increased Health (200 Hitpoints/100 Hearts). When I was testing it I realized that the Zombie was unable to deal any damage to me even though he was hitting me, while normal Zombies could. After some research I found out that Zombies apparently deal more damage the lower their health is.
To fix this bug simply add an exception to the code where if a Zombie has more health than 20, it's treated as if it were 20.
How to reproduce:
Create a Zombie with extremely high Health value (in my case 200 instead of the normal 20) and let it hit you in Survival.