I wouldn't cook the onion. Once you've let the mixture mellow for awhile there won't be any discernable raw taste. If you want, you could grate 'em rather than mince 'em.