How to get xyz coordinates in local coordinate system of joints in skeleton tree of animation?

I am using an automated pipeline to import an animation into UE4 from a fbx file. I would like to import it such that the feet of the animation are on the ground. However, my animation looks like this:

where the “feet” nodes are quite a bit above the “root” node of the animation. The issue is I do not how to find the relative distance between the “feet” node and the “root” node. The skeleton tree only provides relative transforms to the parent nodes and not the coordinates in the local coordinate system of the mesh.

My skeleton tree looks like this:

Does anyone know how I could get the height of the foot node relative the root?