The most common cause for "undefined" and similiar errors is if you added a Plugin and then forget to start a new game.
When you add a plugin (or remove one) in 90% of all cases the old savefiles become incompatible, and loading one risks such errors even on completely unrelated actions.
So please start a new game from the title screen and test is this still happens.
If yes, then we need screenshots of your plugin manager.
Are you sure that yanfly's plugins are in the correct order as given on his website?
They need to be in that order, and your core needs to be uptodate as well, or you can get such errors.
That is not enough, yanfly's Plugins need to be in the exact order as given, and you got that order wrong. For example, message core and its componends need to be above almost anything else, only Main core, menu and class Plugins should be above them. You have them almost at the bottom of your list.
Yanfly himself writes that the order of the Plugins as given on his site is "highly recommended" in red directly above his list, but our experience has shown that if you change the order of the wrong pair of Plugins anything can go wrong.
Several mistakes in your assumptions. I suggest you follow the link "bughunting" in my signature and dead that, especially the part about "for want of a nail..."
If a Plugin modifies an other one, then it needs to be below that other in the Plugin manager, or it will not be able to modify that other one and therefore not work correctly.
If the errors go away when you place it above, it means you removed those errors by introducing others.
And that goes double if you have already hints of what produced those errors instead of this, because those earlier errors were most likely produced by the messages plugin being in the wrong order, not by the messages plugin being above the face plugin.
While I don't appreciate being treated like an idiot, I do appreciate the help. I've gone ahead and completely redone the order of the plugins, making sure to strictly follow the order of Yanfly's plugins on his site.
After doing so, I once again got the same issue as before when trying to use magic. So once again, I moved the DreamX plugin above Yanfly's Message Core plugin, and it resolved the issue.
So this thread can be closed, as I solved the problem myself (again). Thanks.