Okay I found one way to do it.
The problem I encountered was when a mecanim variable is set, the animation does not immediately goto the next state, even when the transition duration is 0.
So what I have to do is use Get Animation Current State Info to get the current Name Hash and compare it with the previous hash, when they are different then I know we're at a new state. I can then use the action again and wait for the Normalized Time to be greater than 1.
I hear this is easier in Unity 5.