You need to know exactly how much your computer or connection lags. And that's not a fixed amount of time, but in relation to what happened in the round (usually chase chains generate a larger delay). And you need to cast the mystery early enough so it happen around the REAL end of round as opposed to what you see.
For nine tail fox, for example, which I always play on 2x, i drop barrier when my main, in 2nd position, is finished with her chase after her attack. That will allow the barrier drop to happen at end of my round. This is a bit easier than what you are looking to do since each round is of pretty much exact same length and therefore lag, which isn't true in sage. But it's a start.