Make sure you got the basics covered first. For loops, if statements, switch statements, declaring variables, operators and comparisons. Hit up the code academy web site if you need to brush up. You may also want to study js classes, functions and data types to make more sense of the existing MV code.
Now the tricky bit is actually doing code for MV, because you are going to be using a lot of existing code and that can be intimidating. The simplest inline scripts you will likely start coding involve setting and reading values from game switches and variables. Example:
Spoiler
flag = true;
for (var i=21; i<30; i++) {
if (!$gameSwitches.value(i)) {flag = false}
}
if (flag) {
$gameSwitches.setValue(30,true);
}
This piece of code is an easier way to check if multiple switches are all set to true. In my case I'm checking switches 21 through 29 and if any one of them is false I turn my flag to false, but if they all checkout as true, then the flag stays true and I set the 30th game switch to true. To do this without scripting would involve a lengthy and repetitive sequence of checks.
To do even more interesting inline scripts you need to figure out and learn how the various game classes work. Some of the biggies like $gameSwitches, $gameVariables, $gameParty, $gameActor, $gameEnemy, $gameEvent.
The majority of the classes you will work with exist in rpg_objects.js, but an easier way to check the functionality of something (assuming you know it exists) is to wrap it in console.log() and check the output in the developer console by pressing F8 in game after the script is run. Example:
console.log($gameParty)
This will show a big list of functions and variables that are attached to $gameParty. You can then test out those functions and variables by wrapping them in a console.log to see if you used it correctly and what the result would be.
Lastly, you will wanna learn about the $data lists. They are representations of the json data that store all the crucial information about your classes, actors, maps, enemies and more. This is the information you put into the database and if you are ever comparing a variable against database information you will want to use the $data list associated to it instead of writing a hard coded comparison.This way if you ever change the database information it will reflect the changes in your code. Here is a simple example:
Spoiler
if (b.hp <= 0){
switch (b.originalName()) {
case $dataEnemies[1].name:
a.learnSkill(12);
break;
}
}
Here I am using the a/b notation for user/target and checking if the enemy I'm fighting has the same name as enemy ID 1 in my enemies list. If it is and I have killed the enemy then I want to learn its skill which is skill ID 12 in my skill list. The beauty here is that if I ever change the name of enemy 1 this code will still work since I am using the name from the database and not a hard coded name.