Self-consistent determination of plasmonic resonances in ternary nanocomposites