I'll leave that up to you :)
I would only have these 3 requirements.
1) I want to insert an item with quality somewhere and somewhere it would return an item 1 quality lower. And I could repeat this process until I get normal quality. If I do it with normal quality, nothing happens and I get back normal quality.
2) Possibility to set in the configuration how many items will be returned after quality reduction. Although I will use 1, I can imagine that someone might want more.
3) So that it works for qualities from other mods as well, not just the 4 basic ones.
It can easily be 1 item into which an object with quality is inserted and it will automatically convert it to 1 quality lower. It will not do anything for normal qualities. It depends on what is easier for you.