Basic scripting question about getting a message to popup.

So I'm trying to pop up a message warning the user if the plugin isn't set up properly.

Here's my code for that part. I'm sure I've made some very basic mistake but I'm new to Javascript and MV scripting so please go easy on me.
// Check to make sure name, attack, and effect are all equal values
if (numCards != numAtks || numCards != numEffects)
{
Game_Message.add("Warning! Your Monster Fighter plugin has not been set up properly!\nError: Uneven");
console.log("UNEVEN!!!");
}

I initially tried "$gameMessage.add();" but that pulled an error as well.

Any advise would be greatly appreciated.
What is the error you're getting? Because if the instance you're planning for would cause the program to crash, you won't get to run a game message call.

In a situation like this, use a try-catch architecture.
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/try...catch

If you wrap the process you're running in the try braces, you can catch any errors, and handle them in the catch portion without crashing your game.

Check that link to learn more. Basically this gives you a chance to handle an error manually, and you can still do things like print out the error message without crashing first.
EDIT:
Also, you can't call Game_Message directly like that, it's a class that's already been instantiated to $gameMessage object. You just use $gameMessage.add, for the bare minimum of using a text box.
Call like this:
Code:
    $gameMessage.newPage();
    $gameMessage.setFaceImage(actorFaceFile, faceIndex);
    $gameMessage.setBackground(type); // 0, 1 or 2
    $gameMessage.setPositionType(pos); //0, 1 or 2
    $gameMessage.add("Your text... Why do I even bother... There are plenty more interesting things to do...");
Call like this:
Code:
    $gameMessage.newPage();
    $gameMessage.setFaceImage(actorFaceFile, faceIndex);
    $gameMessage.setBackground(type); // 0, 1 or 2
    $gameMessage.setPositionType(pos); //0, 1 or 2
    $gameMessage.add("Your text... Why do I even bother... There are plenty more interesting things to do...");

Thank you!

What is the error you're getting? Because if the instance you're planning for would cause the program to crash, you won't get to run a game message call.

In a situation like this, use a try-catch architecture.
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/try...catch

If you wrap the process you're running in the try braces, you can catch any errors, and handle them in the catch portion without crashing your game.

Check that link to learn more. Basically this gives you a chance to handle an error manually, and you can still do things like print out the error message without crashing first.
EDIT:
Also, you can't call Game_Message directly like that, it's a class that's already been instantiated to $gameMessage object. You just use $gameMessage.add, for the bare minimum of using a text box.
The instance doesn't crash the game, but it may cause big errors: in the script events, overtime, so I want to warn anyone who may use the script if it's configured incorrectly.
Darn it, I double posted again, I'm sorry, I'll get it right soon.

Original thread: https://forums.rpgmakerweb.com/threads/basic-scripting-question-about-getting-a-message-to-popup.116273/