GOD invented sex, obviously. Sex is not a sin.
GOD invented masturbation. That is not a sin either.
MAN invented marriage to protect a woman in a very patriarchial society. GOD never once tells anyone they need to get married for any reason, including sex. Only the Church did that. The Church is not GOD, although the Church thinks it can speak for GOD.
So-called "fornication" (ie. sex outside of marriage) is not something GOD invented, again, this is MAN's doing. It is cultural, not eternal. Adultery is the same. MAN invented marriage, not GOD. Adultery is not sinning against GOD. Marriage is a contract with a dissolution clause. It is hardly a moral issue if the contract leaves one with an exit.
Finally, it doesn't matter what my definition of "sin" is.
GOD's definition of sin is always an ACTION, doing something to someone you would not want them doing to you. See Ezekiel 18 for some examples.