Damage formula script MV

When I enter 25*(a.atk/b.def) in the script box of variable, it says b not defined. Is there a way to translate that formula in way RPG maker MV understands?

Also, where are maker specific forums for MV?

Thanks
Do you mean Control Variables > Script? What are you trying to do? What values would you want a and b to be assigned?
Do you mean Control Variables > Script? Exactly!

a is user of skill and b is target of skill. The variable should be equal to the formula 25*(a.atk/b.def)
The problem is, inside control variables b does not exist, as there is no target inside a control variables call. You'll have to get the information another way.

You might want to state what it is exactly you are trying to do, as there is probably another way to do it.
I want to use a follow up skill with yanfly action sequence. There only one way to remove hp from the enemy which is HP -variable or X.
You can set a variable's value in the damage formula directly, e.g.
Code:
v[1] = 25 * (a.atk / b.def); formula
Replace formula with the skill's usual formula, and 1 with the ID of the variable you want to store the value. 🙂

Note that the HP-change actions ignore element rates etc. If you want to actually perform a separate follow-up skill with all the usual rules then you may want to try another plugin, e.g. Yanfly's Skill Core:
Code:
<After Eval>
var skillId = 9;
BattleManager.queueForceAction(user, skillId, -2);
</After Eval>
(Note for others reading this: queueForceAction is from Yanfly's Battle Engine Core plugin.)
Thanks! Is there a way to add a condition? Something like :
<After Eval>
if (user.isStateAffected(121)) {
var skillId = 147;
BattleManager.queueForceAction(user, skillId, -2);
}
<After Eval>
FOr some reason it is not working for me when I add the condition

And what does -2 stand for?
Thanks! Is there a way to add a condition? Something like :
<After Eval>
if (user.isStateAffected(121)) {
var skillId = 147;
BattleManager.queueForceAction(user, skillId, -2);
}
<After Eval>
FOr some reason it is not working for me when I add the condition
Just tested and that works fine for me with only Battle Engine Core and Skill Core, not sure what may be causing the problem for you. 😅
And what does -2 stand for?
-2 means "last selected target"; -1 means "random target"; 0+ means "target at this index in the target unit". 🙂
There's probably a problem with the skill or a plugin that blocks conditional forced actions. Anyway, I will use the variable method + if statement action sequence. Thanks so much for the help and tips!

EDIT: the 121 state was a passive applied from yanfly auto passive plugin and was not
working with force action. If the state is applied manually then it will work.

Original thread: https://forums.rpgmakerweb.com/threads/damage-formula-script-mv.107339/