I think it is Elzo, because he has so much more facetime. also, elzo is an actual "minish cap", while the magic hat is just a "cap made by a minish." i don't see how you can think otherwise, it's so obvious.
Elzo makes the Magic Hat, which grants you a wish. Vaati took the hat and made himself into a Villian. Vaati transformed Elzo into a shape of a duck hat. (Lol) So, the "Magic" hat is Elzo.