Mobs with better attributes or enchantments spawning naturally

How can I make, for example, skeletons always spawn with the flame enchantment or making ghasts with custom attributes? (I suppose the attributes and enchantments are different) and also in which folder do I have to put it in the datapack?
Continue to help post