I wanted to reply to this sooner, but I didn't get to it. Sorry, I needed to double check a few of the details in the editor.
11/10/2012 11:40 AM1) I'm trying to make a unit that when low on hp it tries to run up to it attacker and suicide. How do I get this unit to stop attacking and try to suicide?
Posted by Glacius
Since it sounds like you intend it to target the unit that brought it below whatever threshold (If it can target any enemy unit it wants, you could do something much simpler with an auto-cast ability and an HP validator), a data-driven approach will require the use of a buff behavior with a "damage response".
That would look something like this:
1. Make an ability that executes the suicide attack. Since you haven't specified what that's supposed to look like, I'll leave the details for you to figure out.
2. Create an Issue Order effect (I will call it "Suicidal Attack Order" for reference below) that executes your ability (for most abilities, "ability command" should be 0). Under Effect: Unit set the Value to "Source", and under Target: Target set the Value to "Target Unit" (Or if you want the suicide attack to be dodgeable (i.e. by moving the attacker in time), Target Point should work nicely).
3. Create a Buff type Behavior. Under Combat: Damage Response set Chance to 1 (Don't miss this, it can be a really annoying mistake to make!) and Handled to Suicidal Attack Order. You may want to set the Target Filters here, too, e.g. to exclude Ally and Player, perhaps. This just determines whether there are any units it will not suicide-attack when they bring its hp down (actually, when they attack it all right now. See step 4).
4. To use the suicide ability only when low enough hp is reached, we need a validator. There are several existing validators of this nature, such as Caster Life LT15 Percent, Caster Life LT45, Life < 1/2 HP, and a few different numbers for each of those variations. If you're attaching the buff directly to the unit (in the data editor, in the Unit object), any of them should be usable if you like its number, but it's easy to duplicate one and set whatever fraction or absolute hit points suits your desire. If you need to cast this behavior on units, the validator may not work correctly (If it's important to you, I can go into details) if the "Value" under Validator: Unit is set to "Caster", but either Target or Source should work. Whatever validator you pick/create, apply it to your Buff, in the "Behavior: Validators (Disable)" field of the behavior.
5. Almost there, but a suicider under fire from a variety of units will keep changing target and may get stuck in a loop until it dies. There are a few ways around this, but I'm going to say the best one is to use a second validator, also in the (Disable) field of the Buff (This field is an array, just put both validators in there). This validator is of type Unit Order Queue and the non-default fields are "Validator: Ability" (Set to your suicide attack ability), "Validator: Find" (Set to Disabled), and Value under Validator: Unit (As with the above, the default of Caster may not work if your Buff is castable, in which case use Source or Target, but otherwise you can leave it if you want). The reason this approach is better than others I looked at is that if the suiciding unit's target dies before it gets there, it will be able to pick a new target (although not if you decided to use Target Point, back there).
11/10/2012 11:40 AM2) Can I make a unit get extra minerals when it get a kill?
Posted by Glacius
So you want a particular unit or category of units to get money, perhaps in addition to something standard, for the kills it earns, right? Well I thought I had a simple and pleasant solution for this, but since fatal damage responses at location attacker just don't work (my programmer's intuition says it checks whether the unit with the buff will die instead of the unit taking the damage), it gets more complicated to do this in a data-pure way, and I recommend you follow TerranMaster's advice for a trigger-based approach. You could use a damage response at location attacker to apply a buff with fatal damage response at location defender to issue order to target (attacker) to use ability (transient and not on command card) that grants the player more money, while restricting that ability to units that get this money bonus, though, if you really wanted a data editor solution.
And of course if you actually just want kills to give the player money in general, Palamani's advice is probably best, even though it does require configuration of all units individually.
11/10/2012 11:40 AM3) How can I make an ability that when used has the controlling player lose control. The unit then begins to attack allies and enemies alike.
Posted by Glacius
Easy. You just need to make the ability apply a Buff to the unit. In the Buff, set Value under Behavior: Player to "Hostile". That's honestly all there is to it. You can of course configure some things like duration of the behavior or any side effects you want it to have, but nothing else is required to basically achieve the functionality you describe.