OK, solved
I used this syntax:
set srcip [IP::remote_addr]
set curtime [clock second]
set hash $curtime
set key "count:$srcip:$hash"
if { [ASM::violation count] > 0 } {
table add -subtable "countvio" $key "inserted" indef
set getCount [table keys -subtable "countvio" -count]
if { $getCount< $static::maxRate } {
incr getCount 1
} else {
table delete -all -subtable "countvio"
}}
So the stategy was to create a subtable and insert a new unique key value (used current time seconds for that). And then counted the values in the subtable.