Click here to learn about discrete codes. You can use the Radio Shack 15-2103 or 15-6131, or the OFA 8810/8811 available at Walmart. The remote manuals never mention discrete codes.
There is no way to extract the codes for on/off from the factory macro.
For your Sony tv, you can program the power on function to the tv button on your 3000, and use that in a macro to get discrete power on, but I don’t know how to get a discrete off command. There was a reply somewhere from edmund or cb1 about using a Sony receiver remote to get a discrete off, but since you have a Yamaha receiver that wouldn’t work. Maybe they have another way to get a discrete off but I don’t know what it is.