I suggest looking at how the mod "The Adept" does it.
It's similar in scope to your question, one Hexen class which can wield any Fighter, Cleric or Mage weapon, but only one per slot.
Try studying it and you might be able to tailor the code to your liking
viewtopic.php?f=19&t=31861