How to copy a UStaticMesh asset.

Hello,
I need to copy a static mesh asset in C++ so that I can use it in specific places with altered settings. I have found an old solution here, but it is currently outdated and no matter how much I try to modify it, it does not want to work. Probably because I don’t know how any of it works.

How would I do it in UE 5.3?