MV Checking if a switch is on

Hello,
I have this code (provided by Yanfly) that can check if my actors are in battle or not to apply a state :

<Custom Passive Condition>

// Check if the party is in battle.

if ($gameParty.inBattle()) {

condition = true;

} else {

// Otherwise, set the condition to false.

condition = false;

}

</Custom Passive Condition>

I'd like to use that code to check if a switch is "on". For example if switch 60 is on.
Could anyone tell me how to do that, since my javascript experience is non-existent.
I use this plugin : http://www.yanfly.moe/wiki/Auto_Passive_States_(YEP)

For the record, there is a notetag provided in the plugin that is supposed to do that simply by adding to the state the notetag <Passive Condition: Switch x ON>

But it actually works for the OFF version but not the ON version, I don't know why.

Thanks if you can help me.
Instead of if/else-chain, you can simply use

const condition = $gameSwitches.value(1)
Thank you for your help. Here is the state notetag :
Capture2.PNG


And unfortunately, here was the report I got as soon as I started the game :
Capture.PNG



Did I write it wrong or could you suggest something else ?

I should specify that I'm using it as a passive state on actors, so I want them all to have that state as a passive, and I want it to be active once switch 59 is "on".
There was a small error in what @Aerosys gave you - the eliminating of the extra lines of code is correct, but it should not say const in front.

Just condition = $gameSwitches.value(59);
It's working perfectly ! Thanks a lot both of you.
I've been asking a lot of things lately, but I want to tell you that I'm really thankful for all your help.

Original thread: https://forums.rpgmakerweb.com/threads/checking-if-a-switch-is-on.174022/