void ExecuteAdjustReputationAndAttack(string sTargetTag)
{
    // Get the target object by its tag
    object oTarget = GetObjectByTag(sTargetTag);

    // Check if the target object is valid
    if(GetIsObjectValid(oTarget))
    {
        // Adjust reputation to make them hostile towards each other
        AdjustReputation(OBJECT_SELF, oTarget, -100);

        // Attack the target
        AssignCommand(OBJECT_SELF, ActionAttack(oTarget));
    }
}

void AdjustReputationAndAttack(string sTargetTag)
{
    // Delay the retrieval of the target object and subsequent actions
    DelayCommand(2.0, ExecuteAdjustReputationAndAttack(sTargetTag));
}



void main()
{
    // Retrieve the tag of the target from the local string variable
    string sTagOfTarget = GetLocalString(OBJECT_SELF, "CAS_ATTACKMOB");

    // Check if the tag is not empty
    if(sTagOfTarget != "")
    {
        // Delay 5 seconds, then adjust reputation and attack
        DelayCommand(6.0, AdjustReputationAndAttack(sTagOfTarget));
    }
}
