How to automate the process of duplicating an animation blueprint and retargeting it to a new skeletal mesh?

In an animation blueprint I have functionality in the event graph and anim graph that will be utilized by different skeletons. I can manually duplicate and retarget the animation blueprint with a new skeleton myself, but I’m wondering if it’s possible to do this either through an editor utility widget’s event graph or with python. When I try to duplicate an animation blueprint with asset tools, I get an error that reads “NewAnimBlueprint_C created in Package instead of SkeletalMeshComponent”.