# Get Unit Damage Taken Time

FlagsNative | Function

Returns time for how long it’s been since the unit has taken damage.

# Arguments

  • unit — Unit

Returns — fixed

native fixed UnitGetDamageTakenTime(unit inUnit);

Category: Unit / Combat

# Examples

campaigns/void.sc2campaignbase.sc2maps/maps/campaign/void/pkorhal02.sc2map/MapScript.galaxy:1965

                            autoE09DFEAF_var = UnitGroupUnitFromEnd(autoE09DFEAF_g, autoE09DFEAF_u);
                            if (autoE09DFEAF_var == null) { break; }
                            if ((UnitGetDamageTakenTime(autoE09DFEAF_var) <= 1.0)) {
                                lv_campAggro = true;
                            }

campaigns/void.sc2campaignbase.sc2maps/maps/campaign/void/ppurifier03.sc2map/MapScript.galaxy:2905


    while ((libVCMI_gf_GameIsOver() == false)) {
        if ((UnitGetDamageTakenTime(gv_purifierCoreMatrix) <= 4.0)) {
            if ((lv_pingActive == false)) {
                lv_pingActive = true;

campaigns/void.sc2campaignbase.sc2maps/maps/campaign/void/ppurifier03.sc2map/MapScript.galaxy:2982

    libVoiC_gf_SetAllSoundChannelVolumesCampaign(libVoiC_ge_VolumeChannelModeCampaign_Game);
    TriggerQueueExit();
    while (!((UnitGetDamageTakenTime(gv_purifierCoreMatrix) > 20.0))) {
        Wait(1.0, c_timeAI);
    }

campaigns/void.sc2campaignbase.sc2maps/maps/campaign/void/sc2epilogue02.sc2map/MapScript.galaxy:3119

    libVoiC_gf_SetAllSoundChannelVolumesCampaign(libVoiC_ge_VolumeChannelModeCampaign_Game);
    TriggerQueueExit();
    while (!((UnitGetDamageTakenTime(gv_kERRIGAN) > 20.0))) {
        Wait(1.0, c_timeGame);
    }

campaigns/void.sc2campaignbase.sc2maps/maps/campaign/void/sc2epilogue02.sc2map/MapScript.galaxy:3170

    libVoiC_gf_SetAllSoundChannelVolumesCampaign(libVoiC_ge_VolumeChannelModeCampaign_Game);
    TriggerQueueExit();
    while (!((UnitGetDamageTakenTime(gv_kERRIGAN) > 20.0))) {
        Wait(1.0, c_timeGame);
    }

campaigns/void.sc2campaignbase.sc2maps/maps/campaign/void/sc2epilogue02.sc2map/MapScript.galaxy:3221

    libVoiC_gf_SetAllSoundChannelVolumesCampaign(libVoiC_ge_VolumeChannelModeCampaign_Game);
    TriggerQueueExit();
    while (!((UnitGetDamageTakenTime(gv_kERRIGAN) > 20.0))) {
        Wait(1.0, c_timeGame);
    }

campaigns/void.sc2campaign/base.sc2maps/maps/campaign/void/pkorhal02.sc2mapMapScript.galaxy:1965

                            autoE09DFEAF_var = UnitGroupUnitFromEnd(autoE09DFEAF_g, autoE09DFEAF_u);
                            if (autoE09DFEAF_var == null) { break; }
                            if ((UnitGetDamageTakenTime(autoE09DFEAF_var) <= 1.0)) {
                                lv_campAggro = true;
                            }

campaigns/void.sc2campaign/base.sc2maps/maps/campaign/void/ppurifier03.sc2mapMapScript.galaxy:2905


    while ((libVCMI_gf_GameIsOver() == false)) {
        if ((UnitGetDamageTakenTime(gv_purifierCoreMatrix) <= 4.0)) {
            if ((lv_pingActive == false)) {
                lv_pingActive = true;

campaigns/void.sc2campaign/base.sc2maps/maps/campaign/void/ppurifier03.sc2mapMapScript.galaxy:2982

    libVoiC_gf_SetAllSoundChannelVolumesCampaign(libVoiC_ge_VolumeChannelModeCampaign_Game);
    TriggerQueueExit();
    while (!((UnitGetDamageTakenTime(gv_purifierCoreMatrix) > 20.0))) {
        Wait(1.0, c_timeAI);
    }

campaigns/void.sc2campaign/base.sc2maps/maps/campaign/void/sc2epilogue02.sc2mapMapScript.galaxy:3119

    libVoiC_gf_SetAllSoundChannelVolumesCampaign(libVoiC_ge_VolumeChannelModeCampaign_Game);
    TriggerQueueExit();
    while (!((UnitGetDamageTakenTime(gv_kERRIGAN) > 20.0))) {
        Wait(1.0, c_timeGame);
    }

campaigns/void.sc2campaign/base.sc2maps/maps/campaign/void/sc2epilogue02.sc2mapMapScript.galaxy:3170

    libVoiC_gf_SetAllSoundChannelVolumesCampaign(libVoiC_ge_VolumeChannelModeCampaign_Game);
    TriggerQueueExit();
    while (!((UnitGetDamageTakenTime(gv_kERRIGAN) > 20.0))) {
        Wait(1.0, c_timeGame);
    }

campaigns/void.sc2campaign/base.sc2maps/maps/campaign/void/sc2epilogue02.sc2mapMapScript.galaxy:3221

    libVoiC_gf_SetAllSoundChannelVolumesCampaign(libVoiC_ge_VolumeChannelModeCampaign_Game);
    TriggerQueueExit();
    while (!((UnitGetDamageTakenTime(gv_kERRIGAN) > 20.0))) {
        Wait(1.0, c_timeGame);
    }

mods/warcoop/warclassicsystem.sc2modbase.sc2data/TriggerLibs/WarClassicTactical.galaxy:89

    // Automatic Variable Declarations
    // Implementation
    return ((UnitGetDamageTakenTime(lp_hero) < 1) && (UnitGetPropertyFixed(lp_hero, c_unitPropLife, c_unitPropCurrent) < libGAwT_gv_dYING_HERO_HP));
}

mods/warcoop/warclassicsystem.sc2modbase.sc2data/TriggerLibs/WarClassicTactical.galaxy:437

    }

    if ((UnitGetDamageTakenTime(lp_aIUnit) > 1.0) && (UnitGetPropertyFixed(lp_aIUnit, c_unitPropLifePercent, c_unitPropCurrent) > 50.0) && (UnitGroupCount(UnitGroupFilterAlliance(lp_nearByUnits, lp_owner, c_unitAllianceEnemy, 3), c_unitCountAlive) <= 2)) {
        return ;
    }

mods/warcoop/warclassicsystem.sc2modbase.sc2data/TriggerLibs/WarClassicTactical.galaxy:465

    }

    if ((UnitGetDamageTakenTime(lp_aIUnit) > 1.0)) {
        return ;
    }

mods/warcoop/warclassicsystem.sc2modbase.sc2data/TriggerLibs/WarClassicTactical.galaxy:582


    lv_cost = libGAwT_gf_AIEffectAbilManaCost(lp_owner, lp_aIUnit, lp_abil, lv_level);
    if ((UnitGetDamageTakenTime(lp_aIUnit) > 1.0) && ((UnitGetPropertyFixed(lp_aIUnit, c_unitPropEnergy, c_unitPropCurrent) / 3.0) <= lv_cost)) {
        return ;
    }