Stellar spectroscopy in ground-based ultraviolet. III: Chromospheres and envelopes of cool stars