Convergence rate of an asymptotic preserving scheme for the diffusive limit of the $P$-system with damping