Yanfly Skill Core: Custom Execution Effect

Greetings,

I've been trying to use Yanfly's Skill Core plugin to create a skill with a custom effect that will check the current scene and then activate a switch if the skill is used from the menu. I am trying to have a skill that's usable in battle and on the map that will behave differently in each scene. After searching for a while last night, I ended with this:

Spoiler
<Custom Execution>
SceneManager.is(Scene_Skill) ? $gameSwitches.setValue((50), true) : $gameSwitches.setValue((50), false);
</Custom Execution>

*NOTE: I am not fixed on this one single method and, while this is something I am interested in learning, I am also open to alternative methods of achieving a similar result. I recently spoke with a fellow game maker who is working on the exact same concept and his result was to use 2 plugins, one that runs a group of events at the start of each battle and one that runs a set of events at the end of each battle. Personally I'd rather work with the skill directly and leverage a plugin I am already using.

Plugin link:
http://www.yanfly.moe/wiki/Skill_Core_(YEP)

Thanks!
Maybe this?
Code:
$gameSwitches.setValue(50, SceneManager._scene instanceof Scene_Skill);
I.e. if on the skill scene, turn on switch 50, else turn it off. 🙂

In case you're interested, more details on the instanceof operator can be found here:
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/instanceof
Spoiler
Maybe this?
Code:
$gameSwitches.setValue(50, SceneManager._scene instanceof Scene_Skill);
I.e. if on the skill scene, turn on switch 50, else turn it off. 🙂

In case you're interested, more details on the instanceof operator can be found here:
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/instanceof

It worked perfectly! Thank you so much!

Also, thank you for the link to the reference page. I am currently learning JavaScript and I'm just about done with the basics, every resource helps!
Thank you again for your help!

This thread is being closed, due to being solved. If for some reason you would like this thread re-opened, please report this post and leave a message why. Thank you.

Original thread: https://forums.rpgmakerweb.com/threads/yanfly-skill-core-custom-execution-effect.114447/