Thiol takes priority over alkyl and halo, but not alcohol. The base is the longest chain containing the alcohol substituent. The chain is numbered from the end nearer the alcohol. The nitrile carbon is by definition C-1 of the parent chain. The nitrile takes priority over other groups mentioned so far.
Aldehyde takes priority over ketone, which takes priority over other groups mentioned so far.
Ketones are named as alkanones. Aldehydes are named as alkanals. Carboxylic acids are named as alkanoic acids. The carboxylic acid group takes precedence over all others. Diacids are alkanedioic acids.