The basis for this note tag was the tips and tricks combo state in rmmv but it is written differently in rmmz. That's why I am trying to change stuff, I thought it would be obvious...
Except it is not. Zero of this code needs to be different from MV to MZ except the name of the notetags and the setStateDisplay() - that's what people have been trying to tell you.
Works well in RMMV:rolleyes:
It may do what you want, but then there is extra code doing nothing. Instead of being defensive about it, please read what I'm saying.
The original Tip & Trick you're referring to said:
Code:// Get user's combo stacks.
var stacks = user._comboStacks;
// Reduce user's combo stacks.
stacks -= 2;
// Set stack count min to 0, max to 10.
stacks = stacks.clamp(0, 10);
Read the commented lines for the description of what each line of code is doing.
Your MV version says:
Code:// Get user's combo stacks.
var stacks = user._loveStacks;
// Subtracting the value of stacks from itself ALWAYS produces 0
stacks -= stacks;
// This is meaningless because the value is already always 0
stacks = stacks.clamp(0, 10);
Now your MZ code from Post #1,011:
Code:// You never declare or initialize stacks at all, which I pointed out before
// Therefore, this line is undefined -= undefined which produces Not a Number, NaN
// If you look at your console, you'll see this already produces an error
stacks -= stacks;
// This line never gets executed because you already had an error, but it would also produce an error
// trying to call a function of something that's undefined
stacks = stacks.clamp(0, 10);
And then, as I already said, you have similar errors in your damage formula because you're referencing this stacks thing without ever declaring or initializing it.
You posted your first question
telling us that your code didn't work, so I don't understand why you're reacting defensively when we're answering the question and telling you
why it doesn't work.