… but the engine does do it for you?
Can you read the hlsl of the material and copy paste the relevant sections?
Better yet, you can make it into a .usf and then call the Usf in the custom node.
(Granted I do not remember exactly how that’s done, I know I did do it once).