Maybe the explanations given here can help you:
Code samples are in Python, but the underlying logic is discussed and should be the same. The key for me was that the defined function is actually only a subtraction, but becomes a modulo calculation by including it in a while-True loop. How exactly this mathematical operation helps you evade the missiles is something you’ll have to ask the developers
If you have any more questions, you’ll need to be more specific though.
Also, don’t include your question in the code formatting.