MZ (Common Event Menu) Need some help with a custom JS script

Hey y'all! So I'm trying to make a common event menu that adds an item to the list when a specific switch is turned on. I'm using visustella's common event menu.
Screenshot 2025-12-20 213150.png

This is the very simple psuedo code I wrote for this

Screenshot 2025-12-20 213205.png

And then this is the place in common event menu's plugin command to add the JS. I'm pretty sure there's a JS way to check if a switch is on, although I don't know if I have to declare variables? Any help would be appreciated!
A way to do this without the Common Event Menu Plugin (Creating a list of common events that can be selected, generated with a JS script) would also be heavily appreciated, but I understand that's a lot more to ask lol
Not 100% sure, but the code should look like this:

Code:
// Declare Variables
let list = [];

// check condition
if ($gameSwitches.value(1)) {
  list.push(100);
}

// Return list
return list;

Replace 1 with the Switch ID and 100 with the Common Event ID (if necessary).
Hey, thanks a ton! Will test this out shortly

Original thread: https://forums.rpgmakerweb.com/threads/common-event-menu-need-some-help-with-a-custom-js-script.181544/