Hey! I think you have a few options:
Rename the assets with a prefix for each skeleton
You can use find and replace to rename all the bones, images paths, slots and add a prefix.
To rename your png files in a fast way, on windows you can use RegExRenamer http://regexrenamer.sourceforge.net/
you launch the program, then head to the images folder. in the search field you type: (.*)
and in the replace field you type: prefixname-$1
You can do the exact same in Spine when you enable RegEx find and replace: Tree - Spine User Guide: Regular expressions it sounds complicated but it's really just this.
When you move the skeletons into one master skeleton, you'll need to recreate any constraint you might have had, then reimport the animations.
Export an APNG
This has the great advantage of saving all of the hassle above, it has high quality, but it can be a bit heavy, and it will be a regular image on unsupported super old browsers. Export - Spine User Guide: APNG
Regarding coding options, I can't help you, but I'm sure Mario or Nate will have suggestions 😃