I get an idea of what I want to do and code it to work at the most basic level.
For example, if I want to have something that casts a spell I start with:
Cast(Spell);
And it begins there, then ofcourse I figure out what conditions I want to cast that spell under. Say I want to cast Heal, that means I would want to cast Heal when my HP is at a certain level so it becomes:
if( GetHP(Self) * 100 / (GetMaxHP(Self)+1) < 50 ) then //50 Percent
begin
Cast(Spell);
WaitForTarget(1000);
if( TargetPresent );
TargetToObject(Self);
end;
And so on. Maybe one day I decide to make this into it's own universal casting function that accepts the following information: Cast(SpellName:String; ManaCost,CastTime:Integer) and within itself calculate the effecting mana cost and spell cast/recovery time based on your current LMC,FC,FCR.