The twisted mean square and critical zeros of Dirichlet $L$-functions