How do you control how much damage an attack do?

Hi!
I really don't know much about how you make formulas for skills so I wonder if somebody could explain it and how I can use it in
general.
You just put the calculation you want to use for the damage into the formula box. So if you want the skill to deal base 50 damage + four times the user's MATK - twice the defender's MDEF, you'd do

JavaScript:
50 + a.mat * 4 - b.mdf * 2
it's mathematics, not less and not more.

there are placeholder variables for values from the skill user (a) and the skill target (b), and then the damage is calulated from them.

4*a.atk - 2*b.def

means "take four times the skill user's attac value and substract two times the target defence value tocalculate the damage"

EDIT: ninja'd
okay thank you for your quick answers!

Original thread: https://forums.rpgmakerweb.com/threads/how-do-you-control-how-much-damage-an-attack-do.154003/