Damage formula question

I've not seen this question asked or answered before, so if there's an answer already out there, please direct me to it.

Would a damage formula work with both types of defense accounted for? In other words: a.atk * 25 - b.def + b.mdf

Thank you.
yes

the damage formula is basically an javascript eval and works with all legal javascript commands

you could also use a.agi, b.agi, a,luk, b.luk and many more - even conditional code if you know javascript.

however you need to keep in mind that if using autobattle, the damage formula is processed to check the damage even if some other skill will be selected, and that has unwanted effects if you do more than simple damage calculation.
for example if you add a state by javascript inside the damage formula, that would appear out of nowhere if autobattles are used and another skill makes more damage.
I'm not sure what Autobattle is, but I add states with a.addState(number of the state goes here); and then the damage formula after it.
I'm not sure what Autobattle is
the auto battle trait can be assigned to states, actors, and equipment. it makes the actor choose their actions automatically and its choice is whatever skill it knows that the formula says itll deal the most damage with

but I add states with a.addState()
because it has to run the formula to know the damage itll deal in order to choose its skill, it has to run that addState() as well. that isnt an issue if you dont intend on using the trait, but if you do, youll have to use another method like Yanfly's skill core notetags to carry out those effects.
Cool. thank you both.

Original thread: https://forums.rpgmakerweb.com/threads/damage-formula-question.175622/