Help with Damage Formulas

Hello there. I need a bit of help with the following formula. I have Yanfly's BattleEngineCore and SkillCore plugins on.


if (b.isStateAffected(43)) { 2 * (a.atk * 7 - b.def * 3); } else if (a.isStateAffected(42)) { 2 * (a.atk * 7 - b.def * 3); } else { a.atk * 7 - b.def * 3; }

The idea is that when the enemy is afflicted with a certain state the skill does double the damage, and when the user is afflicted with a different state it also deals double the damage. Here comes the problem: How do I make it so the multipliers stack when both states are active at once? Is it something that can only be done by code on notes? Or is it even possible at all?

Maybe the answer is super obvious and I just don't see it. I just started with MV a week ago so excuse my lack of knowledge. Thank you to anyone who goes out of their way to help.
you could save the formula in a variable, use your conditions independently to multiply that initial variable, and then call the variable at the end...
Code:
var dmg = a.atk * 7 - b.def * 3; if (b.isStateAffected(43)) dmg *=2; if (a.isStateAffected(42)) dmg*=2; dmg
but the skill core already lets you do it easier and clearer with its notetags.
just have the standard formula and add the notetag
Code:
<Pre-Damage Eval>
if (target.isStateAffected(43))
  value *=2;
if (user.isStateAffected(42))
  value *=2;
</Pre-Damage Eval>
It finally worked! Thank you so much!
I really need to learn more about how to do these formulas. Thank you so much for going out of your way to help me.

Original thread: https://forums.rpgmakerweb.com/threads/help-with-damage-formulas.177530/