Cannot read property "length" of undefined

I'm not sure what the issue is, here's what is happening.

I installed the yanfly battle engine core plugin, but I receive this error when I go through the attack commands and right as the enemy battler attacks. It doesn't matter if it's an RTP enemy battler or one of my custom ones.

If I turn off the plugin or remove it entirely it still does this.

The only way I've been able to get this error to not occur is by creating a new project and avoid installing the plugin. I know lots of people use this plugin without issue so it must be something I'm doing wrong when setting it up.
"of undefined" means that there is a reference to an object that doesn't exist.
without a screenshot of the console output of the error we can only guess what it might be, but it can be caused by:
1) deleted database objects that are still referenced in the game, like a troop that contains an enemy that has been deleted, or a skill or animation that has been deleted or so on.
2) using a savefile from before the plugin was added - most changes in the plugn manager require you to start a new game in the playtest
3) wrong order of plugins
4) plugin incompatibilities

Original thread: https://forums.rpgmakerweb.com/threads/cannot-read-property-length-of-undefined.134455/