How can I change the gravity modifier of a particle system through script?

Hello, I’m trying to access and change the gravity modifier of a particle system through script but i cant seem to figure out how to access it. I cant get it through get component and i’ve tried other methods to no avail. Thank in advance

public ParticleSystem _ps;
ParticleSystem.MainModule _psm_main;
public float _gravity= 1f;

void Start()
{
_psm_main = _ps.main;
_psm_main.gravityModifierMultiplier = _gravity;
}