MV Setting Self Variables with Script Calls

I'm trying to figure out how to set Yanfly's Self Variables using script calls from other events. I currently have this script that turns off a self switch for every event that has the name "evtEncounter".

Code:
$gameMap.events().reduce(function(a, c) { var e = c.event(); if (e.name === "evtEncounter") a.push(e.id); return a; }, []).forEach(eventId => $gameSelfSwitches.setValue([$gameMap._mapId, eventId, 'A'], false))

I tried looking through the .js file for Yanfly's Self Switch and Variables, but my understanding of JavaScript is still pretty rough. I put this together, but it doesn't work.

Code:
$gameMap.events().reduce(function(a, c) { var e = c.event(); if (e.name === "evtEncounter") a.push(e.id); return a; }, []).forEach(eventId => $gameSelfSwitches.setValue([$gameMap._mapId, eventId, 'SELF VARIABLE' + 61], 0))

Can anyone point me in the right direction?
in the helpfile there is a scriptcall:

this.getSelfSwitchValue(mapId, eventId, switchId, true)
this.getSelfSwitchValue(mapId, eventId, switchId, false)

this.setSelfSwitchValue(mapId, eventId, switchId, true)
this.setSelfSwitchValue(mapId, eventId, switchId, false)

so you probably need to make some workaround or set it in a way for the mapId, eventId and switchId.
but I dont know how to implement it with your current scriptcall.
Bump.
In Yanfly's plugin the id of the self variable gets detrmined by 'SELF VARIABLE ' + id. In your scriptcall above you are using 'SELF VARIABLE' + id (note the missing space as the last character of the string). I believe that is the source of your problem.
In Yanfly's plugin the id of the self variable gets detrmined by 'SELF VARIABLE ' + id. In your scriptcall above you are using 'SELF VARIABLE' + id (note the missing space as the last character of the string). I believe that is the source of your problem.
This was the rub, thank you so much, everything works perfectly now!

Original thread: https://forums.rpgmakerweb.com/threads/setting-self-variables-with-script-calls.150729/