Yes, that version of the code wipes out the modifiers, then the 'while' counts the modifiers in as it counts the variable down. I was thinking, if the remove_character_modifiers with amount 1 works, it would be simple to reverse the logic to put the number into a variable, subtract 1 from the variable, then use the original logic to put the number of modifiers in the variable back on the character.Just checked these out. Thewhileclause doesn't appear to have anything to do with theremove_character_modifiers. Furthermore, in all 7 of these instances, the command is used to remove all instances of a character modifier anyway (999 for the duels and 30 for the coronation). This makes me think that the command is intended to remove all instances of a modifier anyway, though I'm not sure why they'd do that as simplyremove_character_modifierdoes this anyway.
I just had a thought: are we looking at this backwards? Does 'remove_character_modifier' only remove 1 of a stacking modifier?