Now it's time to get into the technical aspect. The first thing you're going to want to do is download Project Smash Attacks (PSA). That is what we will be using in this example, and I have found it to be the most useful moveset hacking program out there.
Let's take a look at Marth's default file.
This is an image of Marth's down tilt (crouch attack), called AttackLw3. And now let's look at Marth and Lucina's shared AttackLw3.
As you can see, it is a bit more complex. But relatively speaking, it is actually fairly simple. All that changes between Marth and Lucina in this attack is hitboxes without an animation change, making it very easy. The only things that need to be added are an If statement, an "else", and an "end if", in addition to the actual programming for the new attack. Now we'll take a closer look at the new aspect of the programming.
Red=essential new coding to be added
Blue=custom attack coding for Lucina
Green=original attack coding for Marth
Purple=shared coding between both
As you can see above, when it is broken down into its components, this is not difficult at all. Let's take a look at the essential coding.
First off, is the "If compare: LA-Basic[54] >= 6". This is what tells the file "if your costume number is 6 or higher, then do this". There is a specific way you must set up this If statement, or else it will not work properly. You must use the third "If" option listed. That will bring up a menu that looks like this:
The first option is your requirement. This must be set to compare, as shown below.
Next, we have variable. This is where you tell it to look at your costume number, which is set equal to the runtime longterm basic variable 54. So we must tell PSA that we want it to look at LA-Basic[54]. It should look like this.
Next we have comparison method. This is a value, ranging from 0-5. Each number represents a way of comparing two numbers. As you can see on the screen, the values indicate less than, less than or equal to, equal to, =! (I honestly don't know what this means), greater than or equal to, and greater than. For this tutorial, we are going to use greater than or equal to, which is 4. You can use any of these options, just make sure that you select it as a value, not a scalar, as seen below.
Lastly, we have another variable. This is the number that we are comparing to the costume number. In this tutorial, we will be setting this variable to 6. Make sure to set this number as a scalar, and not as a value, otherewise it will not work properly.
Hit done, and we should have something that looks like this:
If Compare: LA-Basic[54] >= 6
Now just use this as you would use any other If statement in programming. Put it above the portion of the code that you want to only occur if your costume number is 6 or higher, then after that coding you must place either an End If, or an Else. The End If will make it so that the coding within will be read if your costume is the proper number, but it will also then read the normal coding for the original character. And that's not always what we want, but in some cases that could be useful.
In this situation, we will be using the Else command give the coding an alternative set of commands to execute if the costume number is not greater than 6. After the alternative set of commands, make sure to place an End If command, so that any shared coding between the different costumes is still read.
Again, it should look something like this when you're done. Of course, it won't have badly painted circles on it, but you get the idea. The commands in purple will happen regardless of costume number. The commands in blue will only happen if your costume number is greater than or equal to 6, and the commands in green will only happen if your costume number is less than 6.
Other than those few specific, but essential, bits of coding, go about writing your attacks as you usally would. Just remember that you need to use as few lines of coding as possible, to ensure you don't exceed file size limits.