MV Skill warmup based on a switch

The long and short of it is, I'm trying to make it so if switch 1 is off, the skill's warmup is 5. If not, it doesn't have a warmup. I tried this (see screenshot) and it just kept adding 5 to the warmup when I toggled the switch. I'm completely lost and would appreciate any help.
1745121896241.png

Edit: Link to the warmup/cooldown plugin: http://www.yanfly.moe/wiki/Skill_Cooldowns_(YEP)

Edit2: SOLVED as per this reply: https://forums.rpgmakerweb.com/index.php?threads/skill-warmup-based-on-a-switch.177087/post-1510096
I'm completely lost and would appreciate any help
warmup - 5 by itself wouldnt do anything. it doesnt subtract 5 from the warmup value. its just a statement saying what that value is. youd need to use warmup -=5 or warmup = warmup - 5 .

since the warmup value becomes the warmup turns, have you tried setting it to 0 instead of subtracting 5? if you dont know what it defaults to, you would want to avoid decrementing it.
warmup - 5 by itself wouldnt do anything. it doesnt subtract 5 from the warmup value. its just a statement saying what that value is. youd need to use warmup -=5 or warmup = warmup - 5 .

since the warmup value becomes the warmup turns, have you tried setting it to 0 instead of subtracting 5? if you dont know what it defaults to, you would want to avoid decrementing it.
Yeah, I tried that originally, and it still continued to just add 5 every time to the warmup.

Edit: I tried this, and now there's no warmup at all.
JavaScript:
<Warmup Eval>
if (!$gameSwitches.value(1)) {
     warmup == 5;
   } else {
    warmup == 0;
   }
</Warmup Eval>

Edit2: For some reason this worked?! I swear this is what I had to begin with...I'm so confused lol
JavaScript:
<Warmup Eval>
if (!$gameSwitches.value(1)) {
     warmup = 5;
   } else {
    warmup = 0;
   }
</Warmup Eval>
Edit: I tried this, and now there's no warmup at all.
a single equal sign and two equal signs mean different things. a single sets the thing on the left to be equal to the right. the double compares the values on both sides and returns either true or false based on if theyre the same value. when you do that, you arent doing anything to the warmup value and its going to use whatever default value was assigned to it.

Yeah, I tried that originally, and it still continued to just add 5 every time to the warmup.
so to be clear, you tried
Code:
<Warmup Eval>
if (!$gameSwitches.value(1)) {
     warmup = 5;
   } else {
    warmup = 0;
   }
</Warmup Eval>
and it only ever added 5? can you confirm the value of that switch both before and after the fight starts? it wouldnt be a surprise if you have a plugin that reserves switch 1 and is actively modifying it.

also if you dont have a <Warmup: x> tag in the skill, then that warmup variable should already be defaulting to 0. strictly speaking, you wouldnt really need the else block

This thread is being closed, due to being solved. If for some reason you would like this thread re-opened, please report this post and leave a message why. Thank you.

Original thread: https://forums.rpgmakerweb.com/threads/skill-warmup-based-on-a-switch.177087/