Take note though that by using Ninja's formula, you could end up with cases where your actor will deal more damage to enemies with high defense than those with defense close to his attack.
For example:
Actor has 10 atk, enemy has 9 defense
Damage will be 1
Actor has 10 atk, enemy has 15 defense
Damage will be 3 (10*0.3)
In case you dont want that, and want the atk*0.3 to be the absolute lowest damage of that attack, just do this instead
This will take whichever value is higher from the two formulas
For example:
Actor has 10 atk, enemy has 9 defense
Damage will be 1
Actor has 10 atk, enemy has 15 defense
Damage will be 3 (10*0.3)
In case you dont want that, and want the atk*0.3 to be the absolute lowest damage of that attack, just do this instead
Code:
[a.atk-b.def,a.atk*0.3].max
This will take whichever value is higher from the two formulas