MZ Add a Yes/No line (tied to a switch) with visustella Options core?

Title says it all.

Question blablablabla: Yes/No

If Yes, switch X is ON, otherwise it's OFF.
How to do that?
If you just want to reference an option in-game then you can do so via Conditional Branch > Script, e.g. to check if the alwaysDash setting is on:
JavaScript:
ConfigManager['alwaysDash']
You can set a value in a similar way, e.g.
JavaScript:
ConfigManager['alwaysDash'] = true;


Otherwise, note that by default all switches reset on game boot, New Game, and Continue, but in-game options do not (typically) reset like this. It sounds like you will need a plugin that lets specific switches keep their values through these transitions. VisuStella Save Core offers this in the form of "Global Switches":


If you still want to sync a persistent game switch with an in-game option, that'll require several edits in the parameters of Options Core. I think the easiest approach would be to show the option like normal but only ever reference/change the value of the persistent switch. Basically, you could make a copy of an existing on/off option, e.g. alwaysDash, then:
  • Swap all instances of this.setConfigValue(symbol, value) for:
    JavaScript:
    $gameSwitches.setValue(1, value)
  • Swap all instances of this.getConfigValue(symbol) for:
    JavaScript:
    $gameSwitches.value(1)
These examples reference game switch 1, change that as appropriate. You might also need to edit other lines, e.g. any direct ConfigManager[symbol] references.
Maybe I'm wrong but... I'm not sure this answers my question.
What I'd like is add an extra (custom) line to Options core:

1618927424593.png


This line should have 2 options: Yes and No. Default position should be No but that doesn't really matter, if it's on Yes I can adapt. However what's important is that Yes should mean Switch X goes ON, and No mean same Switch X goes OFF.

Original thread: https://forums.rpgmakerweb.com/threads/add-a-yes-no-line-tied-to-a-switch-with-visustella-options-core.135669/