ok... i guess i didn't do enough testing, so thanks for pointing out that it works.
i found out what my code is doing. what i was doing was using a function to spawn enemies, and trying to make them check a variable on every turn. (a different variable for different enemies, which is why i needed to pass it to the function). But what the code is actually doing, is just passing the result of that variable at the time of the enemies creation, and then it checks that same result every turn, rather than checking the new result of the variable each turn. I guess there's no way to do what i thought it would do, so i'll have to reorder my code. thanks for the help.