Was using a variable wrong, getting the value it contained directly rather than using that to get the value from $game_variables.
Now accounts for battler level, too.