Okay, lets give this a try:-
A BIT OF BACKGROUND KNOWLEDGE
Tool offsets and fixture datums are 2 different things and need to be treated in different ways.
To do this the correct way we need a machine with a Z axis that homes to a known point, we need a tool setter that is in a fixed position, it can be a removable type with a fixed mount.
We are going to do this so there is NO master tool. All tools have an offset relative to a fixed point on the Z axis head, Dimension D.
LETS FIND SOME DIMENSIONS
Check out the diagram below, the dimension A is the first one we need to find. This will be hard coded into the macro as it will only need to be changed if the machine has a bump or the distance to the table changes.
Pick a point on the under side of the Z axis that will not change, on a router the spindle clamp should be fine, on a mill with a quill it is best to use a machined surface NOT the end of the spindle. Fixed spindle mills and lathes can use the end of the spindle.
To get the A distance we need to home the machine and then use a block of a known size, a slip block will be good. We then sit this on the table and lower the Z axis so the chosen fixed point on the under side of the Z axis touches the block so we can slide it back and forth with a light friction feel.
We then need to look at the machine coordinates (G53) and take note of the value, this is then added to the size of the slip block to give us our A dimension.
Now we need to find the B dimension, this we do by putting a tool in the spindle and touching it on to the setter until we see it trigger, this may be a light on the tool setter or in the mach3/4 diagnostics. Once triggered we take a note of the machine Z value (G53), then move the spindle to touch the tool on the table top using a feeler gauge or paper, note down the Z axis machine value (G53) and add the feeler thickness to the value. Take the first value from the second one and this is the B dimension.
Note, in most cases Z machine values will be minus numbers so when we add the feeler thickness we are adding a minus values to get a bigger minus value.
With the two dimensions and the Z axis G31 SKIP value #5063 we can work out the offset for the tool.
E.g.
F = #5063 (G31 Skip)
If our setter is above the machine table
D = abs(A) - abs(F) - abs(B)
If its below the table top :-
D = abs(A) - abs(F) + abs(B)
With this knowledge we can them set our fixture offsets with ease.
E = -(abs(A) - abs(C))
When we call tool 1 with its offset active and it backs the tool off by the offset amount. This way you can have as many fixture offsets all with different heights and the tool will be in the correct place.