Damage formula assistance please.

Hello.

I have the following damage formula for my water spells, but It isn't working as intended.

if (b.isStateAffected(13)) b.removeState(13); a.mat * 4 - b.mdf * 2
if (b.isStateAffected(13)) b.removeState(13); 0 : a.mat * 4 - b.mdf * 2

My goal is if the enemy is affected by state 13 (burn), I want my actors water spells to remove the state and deal 0 damage.
If the enemy is not affected by state 13, then they are damaged normally, a.mat * 4 - b.mdf * 2

Formula 1 removes the state and deals damage when the enemy is affected by state 13.

Formula 2 deals 0 damage and does not remove the state, I think it also dealt 0 damage when they were not affected by the state as well.

Thank you in advance!
if (b.isStateAffected(13)) {b.removeState(13); 0} else {a.mat * 4 - b.mdf * 2};
...An else statement, of course! I knew it looked wrong for some reason.

I would have gotten the brackets wrong anyway, so thank you so much!

Original thread: https://forums.rpgmakerweb.com/threads/damage-formula-assistance-please.102803/