Within the standard paradigm, dark energy is taken as a homogeneous fluid that drives the accelerated expansion of the universe and does not contribute to the mass of collapsed objects such as galaxies and galaxy clusters. The abundance of galaxy clusters -- measured through a variety of channels -- has been extensively used to constrain the normalization of the power spectrum: it is an important probe as it allows us to test if the standard $Lambda$CDM model can indeed accurately describe the evolution of structures across billions of years. It is then quite significant that the Planck satellite has detected, via the Sunyaev-Zeldovich effect, less clusters than expected according to the primary CMB anisotropies. One of the simplest generalizations that could reconcile these observations is to consider models in which dark energy is allowed to cluster, i.e., allowing its sound speed to vary. In this case, however, the standard methods to compute the abundance of galaxy clusters need to be adapted to account for the contributions of dark energy. In particular, we examine the case of clustering dark energy -- a dark energy fluid with negligible sound speed -- with a redshift-dependent equation of state. We carefully study how the halo mass function is modified in this scenario, highlighting corrections that have not been considered before in the literature. We address modifications in the growth function, collapse threshold, virialization densities and also changes in the comoving scale of collapse and mass function normalization. Our results show that clustering dark energy can impact halo abundances at the level of 10%--30%, depending on the halo mass, and that cluster counts are modified by about 30% at a redshift of unity.