First-principles full-potential linear muffin-tin orbital calculations have been used to study the effect on the cohesion and electronic structure of cubic δ-MoC when 25% of the carbon is substituted for boron, nitrogen, or oxygen and when 25% of the molybdenum is substituted for niobium, tungsten, or ruthenium. A thorough study of the changes in the electronic structure and the effect of these on the properties of the compounds is made. Special attention is paid to the character (ionic, covalent, or metallic) of the states becoming occupied (or unoccupied) due to the substitution. A study is also made on the properties of the quaternary alloy Mo0.75W0.25C0.75N0.25. This substitution is shown to harden δ-MoC.