No offense, but it's still the same, you need to inline the functions like the modulo function. Think monolithic design, all action in just one function block.
I know its stupid to not use functions for readability but jass (or maybe blizzard?) is truly retarded, function calls are slow so we (at least that was the case back when i was still making stuff) have to sacrifice readability. I only suggested this because the overhead of calling a function is taxing considering where this code will be used.
Anyway, to be more precise, inline at least Abs and ModuloReal. This is just my opinion so if you want, you could just wait for a mod to require you to do such. Good luck btw
EDIT: Yeah, jasshelper could inline one-line functions, but since this is jass, only the ones who would use the map optimizer can benefit.