Profane Command

Okey dokey, I'm trying to convert Profane Command to script because it's a monster piece of code (about 500 lines) that could be taken out when I get this right. So far I've got the script (that is, each of the charm's abilities work as expected). I've also expanded Sol's work on XCantBe0 so that X has to be larger than a specified SVar or integer (my stuff id separate from the XCantBe0 stuff for now, although they could probably be merged at some stage). This allows us to actually choose a value for X other than a targeted card's cmc (or whatever else) for cards such as Postmortem Lunge or Minamo Sightbender. Not sure when you might want to, but at least you'd have the option. (Edit: I suppose if the AI were smarter and you had a permanent that could boost power, then it might add a little extra to an activation of Minamo Sightbender so that you don't pump the target's power above X.
)
Anyway, this would enable Profane Command to work as a scripted card IF I could find a way to get the Targeted$CardManaCost and Targeted$Amount of the specific Charm sa. At the moment Targeted$CardManaCost return the cmc of either of the last three abilities when I only need the cmc of the card targeted by the second choice. Likewise, Targeted$Amount needs to only return the number targeted by the last ability.
Any idea's on how to do this? Ideally what I'd want is something similar to StoreSVar for targeting that lets you set a specific SVar based on a specified expression.

Anyway, this would enable Profane Command to work as a scripted card IF I could find a way to get the Targeted$CardManaCost and Targeted$Amount of the specific Charm sa. At the moment Targeted$CardManaCost return the cmc of either of the last three abilities when I only need the cmc of the card targeted by the second choice. Likewise, Targeted$Amount needs to only return the number targeted by the last ability.
Any idea's on how to do this? Ideally what I'd want is something similar to StoreSVar for targeting that lets you set a specific SVar based on a specified expression.