Turn off all Self Switch 'A's

Does anyone know of a simple way of resetting all self switches, but only relating one letter (self switch A for example), in an entire project?

Ideally a simple script would be great but I'm happy to use a plugin if anyone knows of one.

Thanks in advance!
This has been asked before, and received a script sequence as answer - but I don't have it ready, so please search the forum - I know I read it just a few days ago in another topic.
Edit: Forgot the specific letter part, one sec.

Okay, so say you wanted to turn off all A self switches:

Code:
var keys = Object.keys($gameSelfSwitches._data);
var matchingKeys = keys.filter(function(key) { return key.split(",")[2] === "A"; });
for (var i = 0; i < matchingKeys.length; i++) {
  $gameSelfSwitches.setValue(keys[i], false);
}
Code:
var keys = Object.keys($gameSelfSwitches._data);
var matchingKeys = keys.filter(function(key) { return key.split(",")[2] === "A"; });
for (var i = 0; i < matchingKeys.length; i++) {
  $gameSelfSwitches.setValue(keys[i], false);
}

This works perfectly. Thank you!
Working perfectly is what Trihans do best!

Original thread: https://forums.rpgmakerweb.com/threads/turn-off-all-self-switch-as.75311/