MV Dnd initiative roll at beginning of battle

Hi,

I'm trying to implement the solution I found in this thread:

However my understanding of javascript isn't very strong and when OP said he added the following to the Action Speed formula Yanfly Battle System STB:
Code:
if (user === $gameParty.battleMembers()[0]) { $gameVariables.value(11); } else if (user === $gameParty.battleMembers()[1]) { $gameVariables.value(12); } else if (user === $gameParty.battleMembers()[2]) { $gameVariables.value(13); } else if (user === $gameParty.battleMembers()[3]) { $gameVariables.value(14); } else if (user === $gameParty.battleMembers()[4]) { $gameVariables.value(15); } else if (user === $gameParty.battleMembers()[5]) { $gameVariables.value(16); } else if (user === $gameTroop.members()[0]) { $gameVariables.value(19); } else if (user === $gameTroop.members()[1]) { $gameVariables.value(20); } else if (user === $gameTroop.members()[2]) { $gameVariables.value(21); } else if (user === $gameTroop.members()[3]) { $gameVariables.value(22); } else if (user === $gameTroop.members()[4]) { $gameVariables.value(23); } else if (user === $gameTroop.members()[5]) { $gameVariables.value(24); } else if (user === $gameTroop.members()[6]) { $gameVariables.value(25); } else if (user === $gameTroop.members()[7]) { $gameVariables.value(26); } else {10 + ((def-10)/2); }

Where exactly do I make these edits? Somewhere in this section of the code was my best guess - but I really have no clue ;-;
1748323442740.png

If anyone has any ideas pls lmk!! Thankyou 🙂
Nvm! I got it working 😔
I'm dumb and thought it was too long a piece of code to put straight into the Action Speed parameter in the plugin manager... but it works...so this thread can be closed now?
This thread is closed due to being reported as solved. If you need it reopened, report it to let us know.

The “report” button can be found at the bottom of your post box and will send the thread directly to our queue if you need assistance. Thank you!

Original thread: https://forums.rpgmakerweb.com/threads/dnd-initiative-roll-at-beginning-of-battle.177946/