Unfortunately, since Mugen doesn't have a simple round function, which would be perfect here
Floor(x) returns y for any x=[y,y+1)
rounding returns y for any x=[y-0.5,y+0.5)
so Floor(x+0.5) will give you the rounded value, unless you want to use non-standard rounding rules.
We need flow control because if you simply use floor or ceil, either or, at the end point of each rotation, depending on if the actual number is positive or negative (the number without abs applied), you'll miss one palette.
Can't you use abs first, and that way ignore this whole problem?
dest = 2, floor(abs(A * cos(gametime * pi / B) < 0)+0.5)
and you might be wandering why I'm using trigonometry
Actually, yes, I wonder. Wouldn't an even distribution of time for each palette displayed work better? Oh wait, is this supposed to be some sort of a joke or something? I downloaded the character and this is the actual code...
[State -2, VarAdd]
type = VarAdd
trigger1 = GameTime % 5 = 0
var(41) = 1
ignoreHitPause = 1
[State -2, VarSet]
type = VarSet
trigger1 = var(41) = 7 && (PalNo = [1,6])
var(41) = 1
ignoreHitPause = 1
[State -2, RemapPal]
type = RemapPal
trigger1 = GameTime % 5 = 0 && (PalNo = [1,6])
trigger1 = StateNo != 3200 && StateNo != 4110
source = 1,1
dest = 1,var(41)
ignoreHitPause = 1
Simply goes to the next palette every 5 ticks and that's it.
Then again, it definitely could be simpler, for example, like this :
[State -2, RemapPal]
type = RemapPal
trigger1 = GameTime % 5 = 0 && (PalNo = [1,6])
trigger1 = StateNo != 3200 && StateNo != 4110
source = 1,1
dest = 1,1+floor(Gametime /5) %7
ignoreHitPause = 1
Saves a variable, too.