Impurity effects on electron–mode coupling in high-temperature superconductors