Charge motions that look like this:
[Command]
name = "ChargeBF_X"
command = ~30$B,$F,x
Why this is wrong: On the surface, this may seem to be fine. If you've played with a charge character before, then you'll know that holding DB or UB will also count toward the B charge (same applies to DB and DF for D charges). However, if you try to shift for directional input from holding D to DB or UB, you will still retain the charge. Mugen, however, considers this as a new input and you will lose the charge if this were to occur.
Solution: Rather than using Mugen's native command buffer, you'll have to build your own. First, alter the above command to the following:
[Command]
name = "ChargeBF_X"
command = ~$B,$F,x
You'll want to build your charge input buffer using two variables: one for determining how long the direction was held, and the other that tells Mugen how long the charge should be held in the command buffer. The first part is easy. First, make sure the following is in your CMD file:
[Command]
name = "holdback";Required (do not remove)
command = /$B
time = 1
Next, in your State -2, add the following.
[State -2, Back Charge Increment]
type = VarAdd
trigger1 = command = "holdback"
var(0) = 1
ignorehitpause = 1
[State -2, Back Charge Reset]
type = VarSet
trigger1 = command != "holdback"
var(0) = 0
This will increment the variable's value for each tick that you are holding the direction to be charged, and resets it back to 0 when the direction is no longer held. For the second part:
[State -2, Back Charge Buffer Activation]
type = VarSet
trigger1 = var(0) >= 50 ;Change this value to the minimum time you want the direction to be held for.
var(1) = 35
[State -2, Back Charge Buffer Decrement]
type = VarAdd
trigger1 = var(0) < 50 && var(1) > 0 ;Change the value of 50 to whatever you set the value above to.
var(1) = -1
What this does is it tells Mugen to register the back command in the input buffer once it has been held for at least 50 ticks (roughly 5/6 of a second). Once the direction is released, you will then have 35 ticks (a little more than half a second) to complete the charge motion. Finally, in your CMD file, locate the changestate for the special requiring the charge motion and add the lines noted below:
[State -1, Sonic Boom]
type = ChangeState
value = 1100
triggerall = (statetype != A)
triggerall = var(1)>16 ;ADD THIS LINE
triggerall = ctrl
trigger1 = command = "ChargeBF_X"
The above will limit the window to complete the charge motion to 19 (35-16) ticks, all you simply have to do is complete the motion. The 16 can be changed to a smaller value if you need more time to complete the motion, such as with a B,F,B,F motion. For vertical charge motions (D,U), simply repeat the above steps using two different variables and making necessary alterations to account for holding down rather than back. For motions that require a DB charge (such as Vega/Claw's Scarlet Terror and Flying Barcelona Special), simply use the variables for both horizontal and vertical charges.
(parts of code based on code used by P.o.t.S. and Jmorphman)