How do you replicate this code in a blueprint material function

Hi, I found this code for a material function in a Setting Up A Chroma Key Material in UE4 by Ryan Brucks.

Its a material function

{
float Luma = dot(Color, 1);
float ColorMask = exp(-Luma * 2 * PI / LumaMask);
Color = lerp( Color, Luma, ColorMask);
return Color / (dot(Color, 2));
}

How would you set the same function up with a blueprint material function.

Best regards, Fredrik

I haven’t tested this, so it’s pretty much guaranteed to fail, but it should be something similar to this: