MV The function when you are selecting your enemy

I was just wondering what is the function the RMMV JS files that is called when you have chosen your skill and are selecting your individual enemies by highlighting them? Also, what function is called after you have clicked the confirm button on which enemy you are using the skill on?
Off the top of my head, there ISN'T a single function involved when selecting targets after selecting a skill. The battle scene just updates, and if your current status is "picked a skill, but not a target yet", it checks to see if any buttons are pressed that it cares about, and updates the flashing of the current target. Depending on what part of the whole thing interests you, maybe start with the battle scene's update function and follow the code from there.

As far as I can tell, a lot of scenes in RPG Maker use state machines, of various scopes, to control everything without a lot of hard-coded function calls. That's why a lot of functions in the code don't seem to actually DO anything other than set some variable to some value, or set some flag, without doing anything else. That's because during various updates, those values and flags are checked, and THEN stuff happens based on what it finds.

For example, in MZ (probably MV too, but haven't had much need to verify), opening or closing a window doesn't really open or close the window. Instead it sets whether the window is closing or opening... and that's it. But when the next scene update comes around and the engine sees that the window is opening but isn't fully opened yet, it increments how open the window is and redraws it with the new size, then checks to see if it's fully opened now, and says yes if it is. The window pretty much just takes care of itself when told to do something.

TL;DR: Depending on what you're wanting, finding the relevant code is either unintuitive unless you know about state machines, or just difficult because the engine jumps through a LOT of hoops even for "basic" things.

Original thread: https://forums.rpgmakerweb.com/threads/the-function-when-you-are-selecting-your-enemy.146414/