Currently you can make that by custom assets (mods) not by plugins, but I support that idea anyway, because realisation I brought up there has some flaws.
First, you need to do auto-equip plugin so that if you eqiup any cap/helmet/other “Hat” slot, your hair disappears from your inventory. Then that plugins memorizes your hair and then auto eqiups it back on you when you remove your real headwear from your character’s “Hat” slot.
Issue is that this solution isn’t simple and is prone for exploiting (there’s a chance someone will use it for duping items).
So instead of simple plugin you get custom Workshop mod plus advanced plugin.