Attaching a UStaticMesh Object to USkeletalMeshComponent

I have a weapon C++ class which contains the logic for each weapon. There are multiple weapons that a player can posses during the game, so each new weapon is a blueprint class that inherits from the weapon C++ class. I’m currently trying to attach an item (an item that is only for looks only) which is a static mesh to a weapon that the player posses. This static mesh will be different for each of the blueprinted weapons.

I have the following public variable to hold the static mesh for each weapon:

UPROPERTY(EditDefaultsOnly)
 UStaticMesh* CosmeticItem;

I have a socket in the skeleton hierarchy of the weapon where I would like to place this static mesh. This is also held within a variable (StaticItemAttachPoint) in the weapon class. The weapon is being attached to the 1st person pawn mesh via a socket (AttachPoint) outlined by the following line of code:

Mesh1P->AttachToComponent(PawnMesh1p, FAttachmentTransformRules::KeepRelativeTransform, AttachPoint);

Ideally, I would like to first attach the cosmetic static mesh item to the weapon which will then get attached to the 1st person pawn mesh. Something similar to this:

CosmeticItem->AttachToComponent(Mesh1P, FAttachmentTransformRules::KeepRelativeTransform, StaticItemAttachPoint);

Mesh1P->AttachToComponent(PawnMesh1p, FAttachmentTransformRules::KeepRelativeTransform, AttachPoint);

Unfortunately, looking through the API on UStaticMesh there doesn’t appear to be any sort of attach type functions. Which leads me to wonder if I’m approaching this problem in the wrong way.

ideally you would not do it in c++ but in blueprint. You expose the components to blueprint UPROPERTY(EditDefaultOnly) which then let designers create has many blueprints as they want that will inherits from the c++ class.

Maybe I’m not fully understanding what you are suggesting but I believe this is what I’m currently doing.
For example, I have a C++ weapon class. Lets then say I have 3 weapons, a knife, a sword, and a bow. These 3 weapons are created by blueprints that inherit from the C++ weapon class. In these blueprints I’m defining the 1st person mesh for each weapon which then gets attached to the fp arms (PawnMesh1p) in the C++ weapon class. I also have a variable within each blueprint that holds the Static Mesh that I would like to attach to the weapon. This way it allows me to switch which Static Mesh I use for each weapon. However I’m unsure of how to attach this static mesh to the weapon mesh whether it’s in C++ or blueprints? Even though it seems with the current system I have in place attaching it in C++ would make the most sense if it’s possible.