Damage inflict =0?

My enemy has an ATK of 12.

So here's the attack formula when the enemy attacks an actor: a.atk * 3 - b.def * 2

The actor's DEF is 26.

12/26 = 0.4...

how can I make it so that IF the final calculation is below 5, to set the final damage to 5?
That will require a plug-in usually, I think there are some that set the damage to 1 if the calculation would be 0. Though I've heard it can be done with the damage formula if you get creative with it. Maybe check the damage formula MV thread and see if someone has already posted how to do this?
In the scripts:

If (a.atk * 3 - b.def * 2 < 5){
damage = 5;
}

I don't know exactly how to write that in javascript, but the logic is the same.
Math.max(5,a.atk * 3 - b.def * 2)
That would return 5 if the formula <= 5.

Though I've heard it can be done with the damage formula if you get creative with it.

Yes it can be since the damage formula is executed as JavaScript (I'm pretty sure the engine runs it through eval()).

I don't know exactly how to write that in javascript, but the logic is the same.
That is valid JavaScript, and is one of multiple ways of doing it. Though instead of having damage = 5, you'd want it to be just 5 like this. Also added an else.

If (a.atk * 3 - b.def * 2 < 5){5;}else{a.atk * 3 - b.def * 2 < 5;}

Original thread: https://forums.rpgmakerweb.com/threads/damage-inflict-0.88613/