The error points to the function that reserves common events.
Do you have something that is calling a common event on hit? A state? A skill that calls a common event? An action sequence?
Did you recently change the number of common events in the database? Does this happen in a new game, or an old save? A battle test?
I'm leaning towards the cause being something calling a common event that either no longer exists, or an old save calling a common event that exists in the database, but didn't exist at the time the savegame was made.
Eg: You had a steal skill that called common event 21, but then later reduced the total number of common events in the database to 5. Common event 21 no longer exists anymore, so when it tries to read the event commands list, it can't find it, and crashes.
Alt: You have a steal skill that calls common event 21, but you're loading a savegame from when you only had 5 common events in the database, and had increased the number from 5 to 21 to accommodate the new skill. The old save may not have updated the database length for the common events, so it doesn't know there is a common event Id 21, so it can't find the event command list when it goes to check for it.
So yes, I recently was toying with a common event to read the enemies MP (on one encounter though) and realized it didn't work so I removed the event. It was a new event so I have no idea.
*EDIT* Holy crap I just added another blank empty common event and everything works again...
While we're here can I ask why it is this happens? I feel like a big dum but this is a big learning process for me. Thank you so much for the quick response ramza, you're a G.
This happens when you try to reference a database item that doesn't exist. This is different from if you simply deleted the item and left it blank in the database.
A command like getCommonEvent(21) is going to look specifically for index 21 in the list of common events. If you have 25 common events in your database, but the 21st is blank, the event list is going to be blank, so nothing will happen. If you only have 20 common events in your database, DataManager.commonEvents[21] (or whatever the actual object is) does not exist at all. When the next step checks for the event list inside that common event, it fails because the event doesn't exist, so it can't read a property of something that doesn't exist.
The same thing happens if you create a troop of monsters out of a bunch of enemies, and then make the enemy list in the database smaller to delete the enemies you used. Battle testing that troop returns a similar, but different, error, because it's trying to read object properties of something that no longer exists.