Random Encounter On/Off Option

I would like a random encounter system similar to Bravely Default, where you can have the option to turn them on and off. I'm new to creating scripts but I found something like this...

$gameSystem.disableEncounter();

$gameSystem.enableEncounter();

I'm assuming a menu add on script plus that would do the trick? I don't know how to do this stuff yet, so a quick point in the right direction would really make my life better. Thanks!
Modifying the default options menu would probably be the cleanest implementation.

Otherwise, you could try installing Yanfly's Main Menu Manager (http://yanfly.moe/2015/10/17/yep-14-main-menu-manager/) and pinning a commen event to the menu that toggles an "Encounter None" state (Encounter None can be found in States, under the Other tab).
Modifying the default options menu would probably be the cleanest implementation.

Otherwise, you could try installing Yanfly's Main Menu Manager (http://yanfly.moe/2015/10/17/yep-14-main-menu-manager/) and pinning a commen event to the menu that toggles an "Encounter None" state (Encounter None can be found in States, under the Other tab).
I like that idea (the menu one, I'll have to figure that out)

For now I just added an Item that calls a Common Event to switch it on and off. I'll look into how to add menu options later. Thanks for the input!
So I'm trying to add it to the options, I added this to the .js core in hopes it would work (Im just shooting in the dark, honestly...)

Window_Options.prototype.addGeneralOptions = function() {

    this.addCommand(Textmanager.disableEncounter, 'disableEncounter');

    this.addCommand(Textmanager.enableEncounter, 'enableEncounter');

 

It dont work tho, can anyone tell me the right way to handle this so I can just C&P? That'd be delicious
Yanfly, Hime, and Victor all have plugins that either adds a Common Event to the main menu or to the option menu. Hime even has a plugin that allows you to bind Common Events to keys/buttons so that would make it even easier for the player.
You have to create and bind the option. 

this.addCommand('Disable Encounter', 'disableEncounter');^ once you do that on the Window part, you need to create a function for disableEncounter on your Scene_Menu that calls the $gameSystem function.

How does the Bravely Default show it though? I am curious to know.
I've moved this thread to JS Plugin Requests. Please be sure to post your threads in the correct forum next time. Thank you.
I did something like this in ACE, and you can find the script for it here: http://forums.rpgmakerweb.com/index.php?/topic/33348-random-encounter-control-version-041-updated-12615/

I don't know any Javascript, so can't help with the conversion, but maybe this will give you an idea how to implement it via a script? I also used Yanfly's System Manager to bind a switch to the options menu, so the player can turn it on and off.

Only thing to remember: The way I set it up, the fights only occur when the switch is ON. So you'll need to remember to turn the switch ON when you start the game.

Original thread: https://forums.rpgmakerweb.com/threads/random-encounter-on-off-option.54803/