Attack formula for multiple actors

Hi,

So I've been working on a project to make an empowering ability and its been a bit finicky so far.
(I would put all of the common events and stuff so far, but it would take way too long!)

so i am now working on the attack formula for the spells.

When you empower yourself you are given the state "Empowered", "Empowered 2" , "Empowered 3" or "Empowered 4"
And then the attack formula checks what state you are effected with and then power it accordingly.

a.isStateAffected(12) ? 100 + v[23] * 12 + a.mat * 2 - b.mdf * 2 : 25 * a.mat * 2 - b.mdf * 2 ;

This was the first formula I used, and it worked, but it only worked for one character so i tried to make one that detected of you had been effected with "Empowered" or "Empowered 2", it still worked for actor one but for some reason did not work for actor 2, making the damage output 0:

a.isStateAffected(12) ? 100 + v[23] * 12 + a.mat * 2 - b.mdf * 2 : a.isStateAffected(13) ? 100 + v[25] * 12 + a.mat * 2 - b.mdf * 2 : 25 * a.mat * 2 - b.mdf * 2 ;

Anyone wanna help me out and fix the formula for me, or even tell me how to fix it?
In both of those formulas you have a *2:25
Shouldn't that be *2.25 ? Or is it done differently in Javascript than in Ruby?

I am a bit confused by the order that you describe.
In turn one I inflict myself with Empowered. Is that formula being run in the same turn, or the next? If it is the same, can it run such a check when it is only being inflicted now? But that is what you seem to be saying is happening.

If it is the next, then the player might use that skill without having inflicted Empower. Taking the second formula, you check if the actor has state 12 and spell out what happens if that is the case; similarly if the actor has state 13. What I don't see is what that formula would do if the actor has neither state.

Original thread: https://forums.rpgmakerweb.com/threads/attack-formula-for-multiple-actors.87638/