If I'm not mistaken, this process is about the following tables.
_RefSetItemGroup and _RefMagicOptGroup.
I'm not sure, but I think it's related to these tables.
Examining Roc set and immortality sets can give great ideas.
You can experiment with these tables. Please share the process under this thread.
tip: Textdata_object for media side descriptions