I just want a Windows 7 behavior where clinking the icon cycles through all the windows. I know about Alt+' (key above Tab) and Alt+Tab clicking the icon is just more intuitive.
You can do
gsettings set org.gnome.shell.extensions.dash-to-dock click-action 'cycle-windows'
If you mean Enabling Click to Minimize (minimize the window when clicking on the icon) as shown in the gif photo:
It is simple, you can do that by running the following command in your terminal:
gsettings set org.gnome.shell.extensions.dash-to-dock click-action 'minimize'
If you do not like ‘click to minimize’ behavior, you can set it back to default using the command below:
gsettings reset org.gnome.shell.extensions.dash-to-dock click-action
I know the question is tagged ubuntu-dock* but if you are using the Dash to Panel extension you can find a similar setting in Tweaks > Extensions > Dash to panel > Behaviour > Click Action > Set to Cycle through windows.
* the title is broad and Google may pick this up as a search