Conditional Variable in Damage Formula?

Hey folks!
Been trying to figure out how to make my damage formula work.
I'm trying to incorporate
if ($gameActors.actor(x).isWtypeEquipped(x)){ value *= $gameVariables.value(x)}
tried to use it inside of yanfly's damage formula notetag but having an if-statement inside it made the damage pop up twice with a value of 0. Not sure if it'd work inside of the regular formula field. So.. I'm kinda lost. I hope someone knows a way to basically add a different multiplier to the formula depending on the weapon the player has equipped.
In the end, I wanted it to look like this:
value = a.atk;
if($gameActors.actor(1).isWtypeEquipped(1)){
value *= $gameVariables.value(1)
else if($gameActors.actor(2).isWtypeEquipped(2)){
value *= $gameVariables.value(2);
//etc.
}
G'day everyone
var z1 = 0; $gameActors.actor(1).isWtypeEquipped(1) ? z1 = 1 : ($gameActors.actor(2).isWtypeEquipped(2) ? z1 = 2 : z1 = 0); [damage formula here] * z1
This is for skill's formula box
Thank you!
FYI, your problem with your first approach was that you were not using your (curly) braces correctly. Your if statement should look like this:
Code:
if (condition1) {
    doSomething();
}
else {
    if (condition2) {
        doSomethingElse();
    }
}
I think I just missed that, because I re-typed it on here since the original code was a little messy 😛 But yeah, pretty easy oversight if you aren't careful!
Understandable oversight. What caught my eye the most was that you have written in an "else if", which I totally didn't know until just now you could do in JavaScript. (Why didn't I know that? I thought it was different than C in this regard, but I have no idea where I picked that up. Oh well!) So I learned something, too. 😛

Original thread: https://forums.rpgmakerweb.com/threads/conditional-variable-in-damage-formula.90818/