Hey!
It seems I completely misunderstood you. If you need to do this in C++, I checked the documentation of UPrimitiveComponent which fortunately has a public boolean variable bCastHiddenShadow. So in c++ it should be possible to access that variable through SMC and set it for each SMC easily.
I also tried to do this using blueprints and when you uncheck the “Context Sensitive” boolean in the upper corner of the box where you type in the node name, you could find a function “SetCastShadow”. It worked for me when I recreated the issue.
Let me know if it works out for you.