You can adding 3 new variables to gpp file and set the values like that:
global integer dirX dirY dirZ
dirX = 1
dirY = -1
dirZ = -1
after that u can use find/replace feature with "match whole word" option and replace all:
xpos
by
(xpos * dirX)
ypos
by
(ypos * dirY)
zpos
by
(zpos * dirZ)
I'm guessing that your mach3 have wrong configuration. And you should by checking that first. I'm don't know how it working with drilling cycles. So please be careful!!