Your detectable problem is most likely NOT in your main C++ programming, sir. It's either in your actual hack(Hook) or your programs method of injecting that hack.
Tips:
The offset you're writing to may be detected, move a few offsets away, call your own serperate location to write your hack at, then return.
Or
You can try using a .dll method instead of writeprocessmemory if you do.
One of these two problems have always solved it for me but i've done hacks mostly on Blizzard, Relic, and Bioware. Not sure if Steam or WarRock are much different, or whatever you're on.