that sounds as a very inefficient use of common events.
you might want to make a new topic giving examples of your CE use and ask for optimization tips.
I probably could have been more efficient with them. When I first started working on the game I didn't know I had a limit of a 1,000 (I probably should have checked that). So I probably used them more freely than I should have. Plus I have noticed that when my common events get too large they have a tendency to crash the game, which seems to corrupt my files, especially when it happens while I'm saving. So I try to split them up into multiple smaller common events as much as I can.
One day I'll go through them all and see how much space I can free up and then post a topic to see if I can get some tips. That's a good idea. In the meantime, I'm just trying to be as conservative as I can with them.
On a good note: I was able to get the effect I wanted by just adding a temporary State to the enemy and use that to distinguish which skill was being used during the common event. So the moderators can mark this as solved if they like.
As Andar says, that sounds like you're doing something wrong/inefficiently. One should be able to recreate a full-sized game like one of the Final Fantasy or Dragon Quest titles and not come anywhere near to using all of those common events.
My project is admittedly incomplete, but uses all of 30.
Have you looked at all at common plugins for MV? Something like Yanfly's Skill Core that allows you to execute code directly from a skill would be far more efficient. You can also do it with action sequences.
I Googled "rpg maker mv script call switch" and immediately found threads with the correct syntax. It's also in the pinned MV Script Call List. $gameSwitches.setValue(switch ID, true/false)
Andar said you don't (as in it's not the correct thing to do, which was elaborated on by Amaranth), not you can't.
I'm not very good at using script commands and mostly just try to mimic what others do when I use them. I don't understand all the syntax or how the language works. I use a different search engine, but I was only able to find two examples and they were for RPG Maker Ace and MZ. Although I do think I tried that specific command you posted (it was from the MZ example I think) but it was messing up my damage formula when I tried to include it. So I wasn't sure on how to write it into the formula without affecting the damage. Thanks for showing me the script command.
If the Switch is turned ON independently of the skill being used during AI processing, then I doubt I could use this method anyway. It would probably just mess the common event up. I think I found a work around by having the Items and Skills I want to share a common event add a temporary state to the target that allows me to differentiate which was being used during the common event. That seems to be working so far. So I think I'll just use that method since the Battle Formula/Switch idea I had seems problematic.
How? I have a lot of custom mechanics in my game and I'm using like 30 common events.
lol, I'm not sure. I just use a lot of them.