Was thinking about this, and you could make it a little easier by
Move to tool change position and manually change the tool (Pick an X/Y/Z you like)
M5 G0 Xxxx Yxxx Zxxx
Change your tool, attach the ground.
Jog into the region of the corner probe (assuming it’s like the carbide/triq one). I assume if you’re probing for your work piece corner, this is ok. You can then pick up x/y/z all at the same time.
This guy over here -> https://youtu.be/p5u0CKWpAUk
has the bit you want in this macro for the xyz probe. When you probe Z, that’ll give you the tool length offset implicitly.
An alternative would be drop your probe into a known spot, and Z probe only at that spot, but then you would pretty much need two probes - one for the x/y corner of the workpiece, and a second one of known thickness to pick up the tool length/Z. In that case, you also need to set the Z tool offset and do it that way, rather than just setting work Z.
I have no idea how to save the location before you do this, and return to it. I think UGS supports some scripting that might be helpful here, but I know next to nothing about it.
This all seems a little strange, not really understanding why you want to do it this way. UGS’s probe functionality is great, and that’s all you really need to do to handle the tool change.