Rule 1 of anything 3d:
Do not use skeletal meshes for anything that isn’t soft.
Delete the skeleton. Spearare the meshes and bring them to the engine as separate parts.
Create a BP, parent the meshes to each other in their logical order.
Define extend/contract parameters based on whatever you think - a total height variable for instance?
And adjust the mesh Z position accordingly.
Exact code can be whatever, from using timelines to just using the construction script.
Depends on how the asset is used in the end.
And either way, you dont run into the issues you get with skeletal meshes, like having too many and flooring performance, or having bad light on them because this engine sucks at correctly lighting skeletal meshes…