Well I couldn't figure it out either until I saw this thread ->
Problems with Commanding Units which made me look into it and realise why my function calls were crashing and when I was trying to find the gamestate change function I saw where it changed the current gamestate. So it's basically Sheppard's credit that I found this in the first place :P
EDIT: Oh and it seems that TLS was introduced into warcraft III in patch 1.22