As you've emphasized in your fine print, there is a value issue here if they can be merged over again.
So answer this question: which do you want? 1) The elimination of the custom headgear or 2) the elimination of the headgear and card synthesized into the custom? Should custom headgears become account-bound to serve the swapping purpose?
If the answer is #1, we can always make the Yamahan Synthesis just take back and replace the 20k-series hat with another one provided -- no need for a Purifier modification. Otherwise, #2 will be a re-write of the Purifier to re-create the original items.
From a development perspective, the decarding script function can only return the individual pieces back or certain parts -- it cannot re-create the original item (hat already carded with the upgrade values) without some workarounds (which aren't an issue -- it's easy enough to do considering the Synthesis NPC is the reverse). To do it using the already present decarding function would return a +4 Custom Headgear, +0 Hat, and Card individually in other words.
Standard code is as follows:
One thing to note is that option #2 existed for quite awhile and was fixed (due to a dual card exploit) with viewtopic.php?f=58&t=1505.*successremovecards <equipment slot>;
This command will remove all cards from the item found in the specified
equipment slot of the invoking character, create new card items and give them to
the character. If any cards were removed in this manner, it will also show a
success effect.
---------------------------------------
*failedremovecards <equipment slot>,<type>;
This command will remove all cards from the item found in the specified
equipment slot of the invoking character. 'type' determines what happens to the
item and the cards:
0 - will destroy both the item and the cards.
1 - will keep the item, but destroy the cards.
2 - will keep the cards, but destroy the item.
Whatever the type is, it will also show a failure effect on screen.
Another thing to take notice of is the quote "If there was no synthesizing, people would just deal with being fug to begin with." The original owner or person that synthesized the headgear made the decision to "uglify", by some standards, the original hat. Why then is it an issue if the headgear has become that?
Is this thread more about the value of the synthesized (carded) headgear or about for "looks" purposes?
EDIT: One other note that I forgot. The normal decard method would end up with the same exploit from before: a 20k-series headgear with 2 slots unless sealed off properly.