First off, you'll need Dreamscape for Max, so that you can import a .ter
You can use the Heightfield Generate at the end of your chain just before your Planet input. Ie, input your node chain into the green HF Generate, which is attached to a new red HF node. Set up the position of your red HF, then in the green HF Generate node, the area you want to sample, and how large in pixels your samples will be, press generate, then right click on the HF Generate node and choose Save. This will give your a .ter of your area.
Now the hard part, you'll need to know what the highest point is within that area, so you know by how much to extrude your terrain in max. Your x,z (x,y in max) will be where you placed your HF node.
I use this approach to set up camera moves from terrain I've made in TG. I haven't used it for shadow passes, as I've usually just used a quad patch. But I see no real reason for this not working.