The magnetic and ferroelectric properties of the multiferroic system Mn$_{1-x}$Co$_x$WO$_4$ (x=0.135, 0.15, and 0.17) are studied in magnetic fields $H_c$ oriented along the monoclinic $c$-axis. Mn$_{0.85}$Co$_{0.15}$WO$_4$, which is right at the phase boundary between two helical spin structures, exhibits a spontaneous sign change of the ferroelectric polarization when cooled in fields $H_c>$ 25 kOe. The origin of the ferroelectric polarization is studied and two magnetic exchange interactions contributing to the polarization are identified. In Mn$_{0.85}$Co$_{0.15}$WO$_4$ domains of the characteristic helical spin structures, known for x$<$0.15 and x$>$0.15, coexist and form domain boundaries. The contributions of the different domains to the global polarization are determined. The polarization reversal in Mn$_{0.85}$Co$_{0.15}$WO$_4$ can be explained by a combination of various contributions to the polarization and a strong correlation between magnetic domains of different helical spin orders resulting in a smooth transition across the domain walls which preserves the chirality of the spin spiral.