How to access and edit LOD properties from a StaticMesh using C++


I’m trying to access different LODs from a static mesh and edit its properties using C++.
For example. Set cast-shadow property only for LOD3 and LOD4.

I referred this link

Tried using LODResources, LODGroup. Non gave me access to LOD properties I need.
I tried accessing the OwnerComponent using LODData, but for some reason it returns null.

staticMeshComponent->LODData.Num() this returned 0.

I’m new to Unreal and C++ Kindly correct me if my approach is wrong.