The equivalence of cooling to the gradient flow when the cooling step n c and the continuous flow step of gradient flow τ are matched is generalized to gauge actions that include rectangular terms. By expanding the link variables up to subleading terms in perturbation theory, we relate n c and τ and show that the results for the topological charge become equivalent when rescaling τ ≃ n c =ð3 − 15c 1 Þ, where c 1 is the Symanzik coefficient multiplying the rectangular term. We, subsequently, apply cooling and the gradient flow using the Wilson, the Symanzik tree-level improved, and the Iwasaki gauge actions to configurations produced with N f ¼ 2 þ 1 þ 1 twisted mass fermions. We compute the topological charge, its distribution, and the correlators between cooling and gradient flow at three values of the lattice spacing demonstrating that the perturbative rescaling τ ≃ n c =ð3 − 15c 1 Þ leads to equivalent results.