Damage formula help

Im geting 0s as damage and this shouldnt be possible as i setup my formula so that the damage should be at minimum a 1% of the characters max hp, the formula is at follows:

b.mhp * (0.05 - Math.min((((b.def+b.level)-(a.atk+a.level))/1000),0.4))

To my understanding math.min should return the leeser of the 2 values, i gave it a 0.04 which would make it at max 0.05-0.04 so b.mhp*0.01 which should equal to 1% max hp at minimum damage, yet im getting 0 as damage in the latter parts of my testplay with an overpowered defense gear (for testing purposes) this should make the player take around 8 to 12 dmg (mhp is at 1200) accounting variance and multipliers.

Please point me if anything is wrong on the formula approach 😅
is it not /100 instead of /1000 as 1200/100 = 12 and /1000 = 1.2 (not sure though).
You've written 0.4 there, not 0.04.
You've written 0.4 there, not 0.04.
Seems like the typo was the mistake im getting different numbers now 😅
Thanks!

Original thread: https://forums.rpgmakerweb.com/threads/damage-formula-help.153391/