As a Special Energy, you'd need to follow this general wording:
This card can only be attached to [P] Pokémon. This card provides [P] Energy only while this card is attached to a [P] Pokémon.
<effect>
(If this card is attached to anything other than a [P] Pokémon, discard this card.)
However, for specifics, you should use the following wording (Ref: Hoopa-EX, Wally): "When you attach this card from your hand to a [P] Pokemon, you may search[...]evolves from that Pokémon and put it on that Pokémon. This counts as evolving that Pokémon. Shuffle your deck afterward."
I wouldn't add the "If this Energy is discard etcetc", as there is no reliable way of remembering whether or not the BOOST Pokemon was evolved into using the Energy, or not."
Musharna would also need some clarification on specific types of cards for its first attack. What happens if your opponent picks a Stadium card, Energy card, Pokemon card, or the like, that doesn't really have a specific effect? This sort of effect really only works for Item or Supporter cards.