Chronic infections have a multifactorial etiology and can lead to nail changes, including thickening, ridging, and discoloration.
[ncbi.nlm.nih.gov]
However, trachyonychia, nail atrophy, onychomadesis, onycholysis, nail bed erosion, onychoschizia, subungual haemorrhage, nail pitting, nail plate discoloration, cross-ridging
[ncbi.nlm.nih.gov]
Other conditions such as psoriasis and lichen planus can also affect the nails and cause ridging and discolouration.
[laserandskinclinics.co.uk]