// As an additional cost to cast Hatred, pay X life.
this.getSpellAbility().addCost(new PayVariableLifeCost(true));
// Target creature gets +X/+0 until end of turn.
DynamicValue xValue = new GetXValue();
this.getSpellAbility().addEffect(new BoostTargetEffect(xValue, new StaticValue(0), Duration.EndOfTurn));
this.getSpellAbility().addTarget(new TargetCreaturePermanent());
}