I wanted to post this decree from the Magisterium. It is very helpful for your situation: cooperating with onanism.
Denzinger 3634:
Response of the Sacred Penitentiary, April 3, 1916
The Practice of Onanism within Marriage
“Question: Can a woman cooperate legitimately in an action of her husband who, in order to indulge his lust, wants to commit the crime of Onan or the Sodomites and threatens her with death or other grave injury if she does not submit?
“Response: a. If the husband wants to commit the crime of Onan in the marital act, that is, by expelling his seed outside of the vagina after the initiation of copulation; and he threatens his wife with death or other serious injuries if she does not agree with his perverse will, the wife, according to approved theologians, can, in such a case, join herself sexually to her husband since, on her part, she engages in a legitimate object and act, but she permits the sin of her husband for a grave reason, which excuses her: since charity, which would require the prevention of the act, does not oblige in the face of such peril.
“b. If, however, the husband wishes to commit the crime of the Sodomites with her, since Sodomitic intercourse is against nature on the part of both spouses who are united in this way, and, in the judgment of all the learned teachers, is gravely evil, there is clearly no motive, not even to avoid death, that would permit the wife legitimately to carry out such a shameless act with her husband.”